Skip to content

Instantly share code, notes, and snippets.

@johnstew
Created January 31, 2017 03:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnstew/92d5ddf794e49f04b0d005ddb221a384 to your computer and use it in GitHub Desktop.
Save johnstew/92d5ddf794e49f04b0d005ddb221a384 to your computer and use it in GitHub Desktop.
tree-shaking webpack.config.js
const webpack = require('webpack');
const path = require('path');
module.exports = {
entry: path.resolve(__dirname, 'src/index.js'),
output: {
filename: 'index.bundle.js',
path: path.resolve(__dirname, 'build')
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader',
options: {
presets: [
["es2015", { "modules": false }] // IMPORTANT
]
}
}
]
}
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment