#1513 Production optimizations

This commit is contained in:
GrzegorzZajac000 2024-03-08 10:02:04 +01:00
parent 701145c1fd
commit 0165829524
5 changed files with 43 additions and 15 deletions

View File

@ -5,7 +5,9 @@
},
"modules": "commonjs"
}], ["minify", {
"builtIns": false
"builtIns": false,
"keepFnName": true,
"removeDebugger": true
}]],
"env": {
"production": {

View File

@ -25,7 +25,6 @@ const webpack = require('webpack');
const path = require('path');
const ESLintPlugin = require('eslint-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const backgroundProdConfig = {
name: 'background',
@ -64,14 +63,20 @@ const backgroundProdConfig = {
constants: 'constants'
},
optimization: {
moduleIds: 'named',
chunkIds: 'size',
moduleIds: 'size',
concatenateModules: true,
mangleExports: 'size',
removeAvailableModules: true,
removeEmptyChunks: true,
mergeDuplicateChunks: true,
minimize: true,
minimizer: [
new TerserPlugin(),
new CssMinimizerPlugin()
]
new TerserPlugin({
parallel: true
})
],
nodeEnv: 'production'
},
resolve: {
modules: ['node_modules']

View File

@ -72,14 +72,21 @@ const contentScriptProdConfig = {
]
},
optimization: {
moduleIds: 'named',
chunkIds: 'size',
moduleIds: 'size',
concatenateModules: true,
mangleExports: 'size',
removeAvailableModules: true,
removeEmptyChunks: true,
mergeDuplicateChunks: true,
minimize: true,
minimizer: [
new TerserPlugin(),
new TerserPlugin({
parallel: true
}),
new CssMinimizerPlugin()
]
],
nodeEnv: 'production'
},
plugins: [
new ESLintPlugin({

View File

@ -97,14 +97,21 @@ const installPageProdConfig = {
constants: 'constants'
},
optimization: {
moduleIds: 'named',
chunkIds: 'size',
moduleIds: 'size',
concatenateModules: true,
mangleExports: 'size',
removeAvailableModules: true,
removeEmptyChunks: true,
mergeDuplicateChunks: true,
minimize: true,
minimizer: [
new TerserPlugin(),
new TerserPlugin({
parallel: true
}),
new CssMinimizerPlugin()
]
],
nodeEnv: 'production'
},
resolve: {
modules: ['node_modules']

View File

@ -108,14 +108,21 @@ const optionsPageProdConfig = {
constants: 'constants'
},
optimization: {
moduleIds: 'named',
chunkIds: 'size',
moduleIds: 'size',
concatenateModules: true,
mangleExports: 'size',
removeAvailableModules: true,
removeEmptyChunks: true,
mergeDuplicateChunks: true,
minimize: true,
minimizer: [
new TerserPlugin(),
new TerserPlugin({
parallel: true
}),
new CssMinimizerPlugin()
]
],
nodeEnv: 'production'
},
resolve: {
modules: ['node_modules']