2018-01-30 19:06:40 +03:00
|
|
|
var path = require('path');
|
|
|
|
var webpack = require('webpack');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: './js-src/init.js',
|
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, '../js'),
|
|
|
|
publicPath: '/',
|
|
|
|
filename: 'merged.js'
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.vue$/,
|
|
|
|
loader: 'vue-loader',
|
|
|
|
options: {
|
|
|
|
loaders: {
|
|
|
|
},
|
|
|
|
esModule: false
|
|
|
|
// other vue-loader options go here
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
2018-01-31 12:54:22 +03:00
|
|
|
'vue-select': 'vue-select/dist/vue-select.js',
|
2018-01-30 19:06:40 +03:00
|
|
|
'vue': process.env.NODE_ENV === 'production' ? 'vue/dist/vue.min.js' : 'vue/dist/vue.js'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
performance: {
|
|
|
|
hints: false
|
|
|
|
},
|
|
|
|
devtool: '#eval-source-map'
|
|
|
|
};
|
|
|
|
|
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
|
|
module.exports.devtool = '#source-map';
|
|
|
|
// http://vue-loader.vuejs.org/en/workflow/production.html
|
|
|
|
module.exports.plugins = (module.exports.plugins || []).concat([
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'process.env': {
|
|
|
|
NODE_ENV: '"production"'
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
new webpack.optimize.UglifyJsPlugin({
|
|
|
|
sourceMap: true,
|
|
|
|
compress: {
|
|
|
|
warnings: false
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
new webpack.LoaderOptionsPlugin({
|
|
|
|
minimize: true
|
|
|
|
})
|
|
|
|
]);
|
|
|
|
}
|