mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-24 13:55:04 +02:00
Upgrade to webpack 5
This commit is contained in:
+22
-10
@@ -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
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user