Skip to content

Commit

Permalink
Updated webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
wizguin committed Jan 23, 2022
1 parent 76e5350 commit 53a8db1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"dev": "webpack serve",
"editor": "phasereditor2d-launcher -project .",
"build": "webpack --mode production",
"build": "webpack --mode production --env obfuscate=false",
"build-crumbs": "node ./utils/build-crumbs.js"
},
"repository": {
Expand Down
14 changes: 8 additions & 6 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,14 @@ module.exports = (env, argv) => {
config.output.filename = 'yukon.min.js'
config.optimization.minimize = true

config.plugins.push(
new WebpackObfuscator({
rotateStringArray: true,
reservedStrings: ['\s*']
}, [])
)
if (env.obfuscate === 'true') {
config.plugins.push(
new WebpackObfuscator({
rotateStringArray: true,
reservedStrings: ['\s*']
}, [])
)
}
}

return config
Expand Down

0 comments on commit 53a8db1

Please sign in to comment.