Upgrade to webpack 5

This commit is contained in:
2026-03-21 23:28:20 +01:00
parent 2772d82d2e
commit 3addbc1a4e
8 changed files with 942 additions and 1504 deletions
+22 -10
View File
@@ -4,7 +4,7 @@ const common = require('./webpack.common.js');
const compilerOptions = {
...require('./tsconfig.json').compilerOptions,
target: 'es5',
target: 'es6',
module: 'es2015',
};
@@ -15,16 +15,26 @@ module.exports = merge(common, {
'bootstrap-admin': './ts/bootstrap-admin',
'bootstrap-tools': './ts/bootstrap-tools',
},
devtool: 'cheap-eval-source-map',
devtool: 'eval-cheap-source-map',
devServer: {
host: '0.0.0.0',
port: 8090,
hot: true,
historyApiFallback: true,
publicPath: '/assets/scripts/',
stats: 'minimal',
compress: false,
allowedHosts: ['all'],
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET',
'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization'
}
},
stats: {
preset: 'normal',
reasons: true,
modules: true,
errorDetails: true,
moduleTrace: true
},
stats: 'minimal',
output: {
pathinfo: false
},
@@ -49,7 +59,8 @@ module.exports = merge(common, {
},
optimization: {
removeAvailableModules: false,
removeEmptyChunks: false,
removeEmptyChunks: false, // replacement of NamedModulesPlugin(),
moduleIds: 'named',
splitChunks: {
cacheGroups: {
commons: {
@@ -61,8 +72,9 @@ module.exports = merge(common, {
},
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(),
new webpack.DefinePlugin({ DEVELOPMENT: true, TOOLS: true, SERVER: false, BETA: true, TIMING: true, TESTS: false }),
new webpack.DefinePlugin({
DEVELOPMENT: true, TOOLS: true, SERVER: false,
BETA: true, TIMING: true, TESTS: false
}),
],
});