36 lines
757 B
JavaScript
36 lines
757 B
JavaScript
const webpack = require('webpack');
|
|
const CopyPlugin = require('copy-webpack-plugin');
|
|
const CompressionPlugin = require("compression-webpack-plugin")
|
|
const config = require('./webpack.base.js');
|
|
|
|
module.exports = Object.assign(
|
|
config,
|
|
{
|
|
mode: "production",
|
|
optimization:
|
|
{
|
|
minimize: true
|
|
},
|
|
plugins: [
|
|
new webpack.DefinePlugin(
|
|
{
|
|
'process.env':
|
|
{
|
|
'DEBUG': false
|
|
} // set a DEBUG flag that can be used in the scripts (can be skipped)
|
|
}),
|
|
new CopyPlugin([
|
|
{from: 'index.html'},
|
|
{from: 'robot.txt'},
|
|
{from: 'src/lang', to: 'lang'},
|
|
{from: 'assets/public', to: 'assets'}
|
|
]),
|
|
new CompressionPlugin(
|
|
{
|
|
filename: "[path].gz[query]",
|
|
algorithm: "gzip",
|
|
test: /\.js/
|
|
})
|
|
]
|
|
}
|
|
);
|