Created
February 8, 2017 19:09
-
-
Save scurker/838c8d41795a39d851a3e88852f81caf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const webpack = require('webpack') | |
, path = require('path'); | |
module.exports = { | |
entry: { | |
'global': './src/app.jsx', | |
}, | |
resolve: { | |
extensions: ['.js', '.jsx'] | |
}, | |
devtool: 'source-map', | |
module: { | |
rules: [{ | |
test: /\.jsx?$/, | |
exclude: /node_modules/, | |
loader: 'babel-loader', | |
query: { | |
cacheDirectory: true | |
} | |
}] | |
}, | |
plugins: [ | |
new webpack.optimize.UglifyJsPlugin({ | |
sourceMap: true, | |
output: { | |
comments: false | |
} | |
}), | |
new webpack.optimize.CommonsChunkPlugin({ | |
name: 'global', | |
minChunks: 2, | |
children: true | |
}), | |
new webpack.optimize.CommonsChunkPlugin({ | |
name: 'commons', | |
minChunks: 2, | |
children: true | |
}), | |
new webpack.DefinePlugin({ | |
APP_ENV: JSON.stringify('browser') | |
}) | |
], | |
output: { | |
path: path.join(__dirname, './public/assets'), | |
publicPath: '/assets/', | |
filename: '[name].js', | |
sourceMapFilename: '[file].map' | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment