40 lines
816 B
JavaScript
40 lines
816 B
JavaScript
var path = require('path');
|
|
var webpack = require('webpack');
|
|
|
|
module.exports = {
|
|
entry: [
|
|
'./src/js/index'
|
|
],
|
|
output: {
|
|
path: path.join(__dirname, 'dist'),
|
|
filename: 'bundle.js',
|
|
publicPath: '/'
|
|
},
|
|
module: {
|
|
preLoaders: [
|
|
{ test: /\.js$/, loader: 'eslint', exclude: /node_modules/ }
|
|
],
|
|
loaders: [
|
|
{ test: /\.js$/, loader: 'babel', exclude: /node_modules/ },
|
|
{ test: /\.css$/, loader: 'style!css' }
|
|
]
|
|
},
|
|
plugins: [
|
|
new webpack.DefinePlugin({
|
|
__DEV__: false,
|
|
'process.env': {
|
|
NODE_ENV: JSON.stringify('production')
|
|
}
|
|
}),
|
|
new webpack.optimize.DedupePlugin(),
|
|
new webpack.optimize.OccurenceOrderPlugin(),
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
compress: {
|
|
warnings: false
|
|
}
|
|
})
|
|
]
|
|
};
|
|
|
|
|