Skip to content

Commit

Permalink
fix(build): fix the minified build
Browse files Browse the repository at this point in the history
  • Loading branch information
solkimicreb committed Jan 13, 2018
1 parent 5040962 commit 026b9f7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ async function build () {
`${config.output.format}.es6.min.js`
)
const { code: es6MinCode } = babel.transform(es6Code, {
presets: ['minify']
// dead code elimination breaks the delete trap
// by moving the hadKey part after the deletion, which always results in false
presets: [['minify', { deadcode: false }]]
})
fs.writeFileSync(es6MinPath, es6MinCode, 'utf-8')

Expand All @@ -92,7 +94,7 @@ async function build () {
`${config.output.format}.es5.min.js`
)
const { code: es5MinCode } = babel.transform(es5Code, {
presets: ['minify']
presets: [['minify', { deadcode: false }]]
})
fs.writeFileSync(es5MinPath, es5MinCode, 'utf-8')
}
Expand Down

0 comments on commit 026b9f7

Please sign in to comment.