2019-11-13 07:52:13 -07:00
|
|
|
const path = require('path');
|
|
|
|
const TerserPlugin = require('terser-webpack-plugin');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
mode: 'production',
|
|
|
|
entry: {
|
|
|
|
index: './web_src/js/index.js',
|
|
|
|
},
|
|
|
|
devtool: 'source-map',
|
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, 'public/js'),
|
2019-11-14 14:39:51 -07:00
|
|
|
filename: '[name].js'
|
2019-11-13 07:52:13 -07:00
|
|
|
},
|
|
|
|
optimization: {
|
|
|
|
minimize: true,
|
2019-11-14 14:39:51 -07:00
|
|
|
minimizer: [new TerserPlugin({
|
|
|
|
sourceMap: true,
|
|
|
|
})],
|
2019-11-13 07:52:13 -07:00
|
|
|
},
|
2019-11-14 14:39:51 -07:00
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
exclude: /node_modules/,
|
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
presets: [
|
|
|
|
[
|
|
|
|
'@babel/preset-env',
|
|
|
|
{
|
|
|
|
useBuiltIns: 'entry',
|
|
|
|
corejs: 3,
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2019-11-13 07:52:13 -07:00
|
|
|
};
|