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-11 22:40:45 +00:00
|
|
|
const script = (name, min=false) => {
|
2016-09-09 20:56:20 +00:00
|
|
|
return {
|
2016-09-11 22:40:45 +00:00
|
|
|
entry: path.join(__dirname, 'index.js'),
|
|
|
|
output: {
|
|
|
|
path: __dirname,
|
|
|
|
filename: min?`${name}.min.js`:`${name}.js`
|
|
|
|
},
|
|
|
|
devtool: min?'source-map':null,
|
|
|
|
module: {
|
|
|
|
loaders: [{
|
|
|
|
test: /\.js/,
|
|
|
|
loader: 'babel-loader'
|
|
|
|
}]
|
|
|
|
},
|
|
|
|
plugins: !min?[]:[
|
|
|
|
new webpack.optimize.DedupePlugin(),
|
|
|
|
new webpack.optimize.OccurenceOrderPlugin(),
|
|
|
|
new webpack.optimize.UglifyJsPlugin(),
|
|
|
|
],
|
2016-09-09 20:56:20 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2016-09-11 22:40:45 +00:00
|
|
|
export default [
|
|
|
|
script('frontexpress'),
|
|
|
|
script('frontexpress', true)
|
|
|
|
];
|