mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-03 18:22:57 +00:00
dev day #67
This commit is contained in:
@@ -4,6 +4,39 @@ module.exports = {
|
||||
webpack: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, 'src/')
|
||||
}
|
||||
},
|
||||
configure: (webpackConfig) => {
|
||||
// Optimize for production builds
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
// Reduce memory usage during build
|
||||
webpackConfig.optimization = {
|
||||
...webpackConfig.optimization,
|
||||
splitChunks: {
|
||||
chunks: 'all',
|
||||
cacheGroups: {
|
||||
defaultVendors: {
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
priority: -10,
|
||||
reuseExistingChunk: true,
|
||||
},
|
||||
default: {
|
||||
minChunks: 2,
|
||||
priority: -20,
|
||||
reuseExistingChunk: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
// Use single runtime chunk
|
||||
runtimeChunk: 'single',
|
||||
};
|
||||
|
||||
// Disable source maps if env variable is set
|
||||
if (process.env.GENERATE_SOURCEMAP === 'false') {
|
||||
webpackConfig.devtool = false;
|
||||
}
|
||||
}
|
||||
|
||||
return webpackConfig;
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user