Commit 6dd90100 authored by Mike Greiling's avatar Mike Greiling

upgrade to webpack 2.2.x

parent 0a36693c
...@@ -48,24 +48,23 @@ var config = { ...@@ -48,24 +48,23 @@ var config = {
devtool: 'inline-source-map', devtool: 'inline-source-map',
module: { module: {
loaders: [ rules: [
{ {
test: /\.(js|es6)$/, test: /\.(js|es6)$/,
exclude: /(node_modules|vendor\/assets)/, exclude: /(node_modules|vendor\/assets)/,
loader: 'babel-loader', loader: 'babel-loader',
query: { options: {
presets: ['es2015', 'stage-2'] presets: [
["es2015", {"modules": false}],
'stage-2'
]
} }
}, },
{ {
test: /\.(js|es6)$/, test: /\.(js|es6)$/,
exclude: /node_modules/, exclude: /node_modules/,
loader: 'imports-loader', loader: 'imports-loader',
query: 'this=>window' options: 'this=>window'
},
{
test: /\.json$/,
loader: 'json-loader'
} }
] ]
}, },
...@@ -86,7 +85,7 @@ var config = { ...@@ -86,7 +85,7 @@ var config = {
], ],
resolve: { resolve: {
extensions: ['', '.js', '.es6', '.js.es6'], extensions: ['.js', '.es6', '.js.es6'],
alias: { alias: {
'~': path.join(ROOT_PATH, 'app/assets/javascripts'), '~': path.join(ROOT_PATH, 'app/assets/javascripts'),
'bootstrap/js': 'bootstrap-sass/assets/javascripts/bootstrap', 'bootstrap/js': 'bootstrap-sass/assets/javascripts/bootstrap',
...@@ -102,14 +101,16 @@ if (IS_PRODUCTION) { ...@@ -102,14 +101,16 @@ if (IS_PRODUCTION) {
config.devtool = 'source-map'; config.devtool = 'source-map';
config.plugins.push( config.plugins.push(
new webpack.NoErrorsPlugin(), new webpack.NoErrorsPlugin(),
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false
}),
new webpack.optimize.UglifyJsPlugin({ new webpack.optimize.UglifyJsPlugin({
compress: { warnings: false } sourceMap: true
}), }),
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.env': { NODE_ENV: JSON.stringify('production') } 'process.env': { NODE_ENV: JSON.stringify('production') }
}), })
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurrenceOrderPlugin()
); );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment