Skip to content

Commit 1cfba8e

Browse files
ink8bitHaroenv
authored andcommitted
Webpack config (#606)
* Change webpack config * Change formatting
1 parent 62024d5 commit 1cfba8e

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

webpack.config.js

+10-11
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const webpack = require('webpack');
33
const ManifestPlugin = require('webpack-manifest-plugin');
44
const HappyPack = require('happypack');
55

6-
let plugins = [
6+
const plugins = [
77
new webpack.EnvironmentPlugin({
88
NODE_ENV: 'development', // use 'development' unless process.env.NODE_ENV is defined
99
}),
@@ -27,10 +27,9 @@ let plugins = [
2727
}),
2828
new webpack.optimize.CommonsChunkPlugin({
2929
name: 'vendor',
30-
minChunks: module => {
31-
// this assumes your vendor imports exist in the node_modules directory
32-
return module.context && module.context.indexOf('node_modules') !== -1;
33-
},
30+
// this assumes your vendor imports exist in the node_modules directory
31+
minChunks: module =>
32+
module.context && module.context.includes('node_modules'),
3433
}),
3534
new webpack.LoaderOptionsPlugin({
3635
minimize: true,
@@ -44,9 +43,8 @@ if (process.env.NODE_ENV === 'production') {
4443
}
4544

4645
module.exports = {
47-
devtool: process.env.NODE_ENV === 'production'
48-
? 'source-map'
49-
: 'cheap-source-map',
46+
devtool:
47+
process.env.NODE_ENV === 'production' ? 'source-map' : 'cheap-source-map',
5048
entry: {
5149
common: './js/src/common.js',
5250
documentation: './js/src/documentation.js',
@@ -57,9 +55,10 @@ module.exports = {
5755
},
5856
output: {
5957
path: path.join(__dirname, './js/build'),
60-
filename: process.env.NODE_ENV === 'production'
61-
? '[name].[chunkhash].js'
62-
: '[name].js',
58+
filename:
59+
process.env.NODE_ENV === 'production'
60+
? '[name].[chunkhash].js'
61+
: '[name].js',
6362
},
6463
module: {
6564
rules: [

0 commit comments

Comments
 (0)