Skip to content

Commit

Permalink
fix: remove spec specific code in production build
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Dec 29, 2020
1 parent 345f5d1 commit 15c15c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .terserrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
const isDev = process.env.NODE_ENV !== "production"
const isTest = process.env.NODE_ENV === "test"

module.exports = {
// "module": false, // controlled by Parcel
"compress": {
"global_defs": {
// remove spec specific code for production
"@atom.inSpecMode": !isTest ? "() => false" : "() => true"
},
"ecma": "2018", // Change based on the target
// "toplevel": true, // controlled by Parcel
"hoist_vars": false,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"build": "cross-env NODE_ENV=production parcel build --target main lib/main.js",
"build-commit": "npm run clean && build-commit -o dist",
"esdoc": "esdoc -c esdoc.json",
"test": "atom --test spec",
"test": "cross-env NODE_ENV=test atom --test spec",
"bump": "ncu -u",
"prepare": "npm run build"
},
Expand Down

0 comments on commit 15c15c5

Please sign in to comment.