perf: update scss-loader

This commit is contained in:
ibuler
2025-12-24 14:08:40 +08:00
parent 261e84f7e7
commit c6ea8488ec
3 changed files with 856 additions and 2696 deletions

View File

@@ -34,6 +34,7 @@
"axios": "^1.7.9",
"axios-retry": "^4.5.0",
"babel-loader": "^10.0.0",
"babel-runtime": "^6.26.0",
"caniuse-lite": "^1.0.30001642",
"core-js": "^3.47.0",
"cron-parser": "^4.9.0",
@@ -87,7 +88,7 @@
"@babel/core": "^7.28.5",
"@babel/eslint-parser": "^7.24.7",
"@babel/register": "^7.28.3",
"@vue/babel-plugin-jsx": "^2.0.1",
"@vue/babel-plugin-jsx": "^1.2.2",
"@vue/cli-plugin-babel": "^5.0.8",
"@vue/cli-plugin-eslint": "^5.0.8",
"@vue/cli-plugin-unit-jest": "^5.0.8",
@@ -129,6 +130,7 @@
"svgo": "^4.0.0",
"vue-eslint-parser": "^10.2.0",
"vue-i18n-extract": "^2.0.7",
"vue-loader": "^17.0.0",
"webpack": "^5.104.1"
},
"engines": {

View File

@@ -180,7 +180,9 @@ module.exports = {
vue$: '@vue/compat',
// Ensure runtime deps for svg-sprite-loader resolve from top-level node_modules
'svg-baker-runtime': resolve('node_modules/svg-baker-runtime'),
'svg-sprite-loader': resolve('node_modules/svg-sprite-loader')
'svg-sprite-loader': resolve('node_modules/svg-sprite-loader'),
// Ensure vue-loader resolves from top-level node_modules
'vue-loader': resolve('node_modules/vue-loader')
},
fallback: {
path: require.resolve('path-browserify')
@@ -263,7 +265,7 @@ module.exports = {
// Use html-webpack-plugin hooks to inline runtime chunk (webpack 5 compatible)
// This replaces script-ext-html-webpack-plugin which doesn't support webpack 5
const HtmlWebpackPlugin = require('html-webpack-plugin')
class InlineRuntimeChunkPlugin {
apply(compiler) {
compiler.hooks.compilation.tap('InlineRuntimeChunkPlugin', compilation => {
@@ -271,7 +273,7 @@ module.exports = {
'InlineRuntimeChunkPlugin',
(data, cb) => {
const runtimeChunkRegex = /runtime\..*\.js$/
// Find and inline runtime chunk scripts
if (data.assetTags && data.assetTags.scripts) {
data.assetTags.scripts = data.assetTags.scripts.map(tag => {
@@ -282,7 +284,7 @@ module.exports = {
const publicPath = compilation.outputOptions.publicPath || ''
const assetPath = src.replace(publicPath, '').replace(/^\//, '')
const asset = compilation.assets[assetPath]
if (asset) {
return {
tagName: 'script',
@@ -296,16 +298,16 @@ module.exports = {
return tag
})
}
cb(null, data)
}
)
})
}
}
config.plugin('InlineRuntimeChunkPlugin').use(InlineRuntimeChunkPlugin).after('html')
config.optimization.splitChunks({
chunks: 'all',
cacheGroups: {

3532
yarn.lock

File diff suppressed because it is too large Load Diff