2016-09-08 21:19:07 +00:00
|
|
|
import webpack from 'webpack';
|
|
|
|
import path from 'path';
|
2016-09-08 19:42:00 +00:00
|
|
|
|
2016-09-09 20:56:20 +00:00
|
|
|
const entry = path.join(__dirname, 'index.js');
|
|
|
|
const module = {
|
|
|
|
loaders: [{
|
|
|
|
test: /\.js/,
|
|
|
|
loader: 'babel-loader'
|
|
|
|
}]
|
|
|
|
};
|
|
|
|
const output = (min=false) => {
|
|
|
|
const filename = min?'frontexpress.min.js':'frontexpress.js';
|
|
|
|
return {
|
2016-09-08 19:42:00 +00:00
|
|
|
path: __dirname,
|
2016-09-09 20:56:20 +00:00
|
|
|
filename
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export default [{
|
|
|
|
entry,
|
|
|
|
output: output(true),
|
|
|
|
module,
|
2016-09-08 19:42:00 +00:00
|
|
|
plugins: [
|
|
|
|
new webpack.optimize.DedupePlugin(),
|
|
|
|
new webpack.optimize.OccurenceOrderPlugin(),
|
2016-09-09 20:56:20 +00:00
|
|
|
new webpack.optimize.UglifyJsPlugin(),
|
2016-09-08 19:42:00 +00:00
|
|
|
],
|
2016-09-09 20:56:20 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
entry,
|
|
|
|
output: output(),
|
|
|
|
module
|
|
|
|
}];
|