Skip to content

Commit

Permalink
Enable webpack tree-shaking
Browse files Browse the repository at this point in the history
Do not transform modules in src/ to commonjs to take benefit of
tree-shaking (c.f webpack.config.js). However, keep it for unit
tests (c.f .babelrc).

https://babeljs.io/docs/plugins/preset-es2015/#optionsmodules
  • Loading branch information
dighan authored and mangui committed Jul 18, 2017
1 parent 149b9fe commit f148d95
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["es2015"]
}
{
"presets": ["latest"]
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
},
"devDependencies": {
"arraybuffer-equal": "^1.0.4",
"babel-cli": "^6.23.0",
"babel-preset-es2015": "^6.18.0",
"babel-core": "^6.22.1",
"babel-preset-latest": "^6.22.0",
"babel-loader": "^6.2.10",
"babel-register": "^6.18.0",
"chromedriver": "^2.27.1",
Expand Down
4 changes: 3 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ var config = {
],
loader: 'babel-loader',
options: {
presets: ['es2015']
presets: [
['latest', { es2015: { modules: false } }]
]
}
}]
},
Expand Down

0 comments on commit f148d95

Please sign in to comment.