mirror of
https://github.com/LukeHagar/firecamp.git
synced 2025-12-06 12:27:44 +00:00
chore: webpack build improvement
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const { merge } = require('webpack-merge');
|
||||
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
||||
// const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
const base = require('./webpack.common');
|
||||
|
||||
// const withReport = process.env.npm_config_withReport;
|
||||
@@ -9,9 +10,25 @@ const base = require('./webpack.common');
|
||||
module.exports = merge(base, {
|
||||
mode: 'development',
|
||||
devtool: 'cheap-module-source-map',
|
||||
output: { clean: true },
|
||||
output: {
|
||||
clean: true,
|
||||
globalObject: 'this',
|
||||
filename: '[name].dev.js',
|
||||
chunkFilename: '[name].dev.js',
|
||||
path: `${__dirname}/build/${env}`,
|
||||
publicPath: '',
|
||||
},
|
||||
optimization: {
|
||||
nodeEnv: 'development',
|
||||
minimizer: [
|
||||
new TerserPlugin({
|
||||
parallel: 4,
|
||||
minify: TerserPlugin.esbuildMinify,
|
||||
// terserOptions: {
|
||||
// sourceMap: 'external',
|
||||
// },
|
||||
}),
|
||||
],
|
||||
},
|
||||
devServer: {
|
||||
//server: 'https',
|
||||
|
||||
Reference in New Issue
Block a user