Ignore tests in build

This commit is contained in:
Sebastian Rindom
2020-03-24 14:23:07 +01:00
parent 2692b860dc
commit f50de7fac3
2 changed files with 18 additions and 9 deletions

View File

@@ -1,9 +0,0 @@
{
"plugins": ["@babel/plugin-proposal-class-properties"],
"presets": ["@babel/preset-env"],
"env": {
"test": {
"plugins": ["@babel/plugin-transform-runtime"]
}
}
}

View File

@@ -0,0 +1,18 @@
let ignore = [`**/dist`]
// Jest needs to compile this code, but generally we don't want this copied
// to output folders
if (process.env.NODE_ENV !== `test`) {
ignore.push(`**/__tests__`)
}
module.exports = {
plugins: ["@babel/plugin-proposal-class-properties"],
presets: ["@babel/preset-env"],
env: {
test: {
plugins: ["@babel/plugin-transform-runtime"],
},
},
ignore,
}