mirror of
https://github.com/LukeHagar/firecamp.git
synced 2025-12-09 20:37:45 +00:00
chore: webpack env optimization
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const { merge } = require('webpack-merge');
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
// const CompressionPlugin = require('compression-webpack-plugin');
|
||||
const base = require('./webpack.common');
|
||||
|
||||
@@ -15,6 +16,15 @@ const config = merge(base, {
|
||||
chunkFilename: '[name].bundle.js',
|
||||
path: path.join(__dirname, `./build/${nodeEnv}`),
|
||||
},
|
||||
optimization: {
|
||||
nodeEnv: 'production',
|
||||
minimize: true,
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
parallel: 2,
|
||||
}),
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new webpack.ProvidePlugin({
|
||||
React: 'react',
|
||||
|
||||
Reference in New Issue
Block a user