@rsbuild/plugin-vue2 1.0.5 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +7 -1
- package/dist/index.js +7 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -69,13 +69,19 @@ class VueLoader15PitchFixPlugin {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
const isPlainObject = (obj)=>null !== obj && 'object' == typeof obj && '[object Object]' === Object.prototype.toString.call(obj);
|
|
72
|
+
const isDefaultPreset = (config)=>{
|
|
73
|
+
const { performance, splitChunks } = config;
|
|
74
|
+
if (performance.chunkSplit && 'object' == typeof splitChunks && 0 === Object.keys(splitChunks).length) return performance.chunkSplit?.strategy === 'split-by-experience';
|
|
75
|
+
if ('object' == typeof splitChunks) return !splitChunks.preset || 'default' === splitChunks.preset;
|
|
76
|
+
return false;
|
|
77
|
+
};
|
|
72
78
|
const applySplitChunksRule = (api, options = {
|
|
73
79
|
vue: true,
|
|
74
80
|
router: true
|
|
75
81
|
})=>{
|
|
76
82
|
api.modifyBundlerChain((chain, { environment })=>{
|
|
77
83
|
const { config } = environment;
|
|
78
|
-
if ('
|
|
84
|
+
if (!isDefaultPreset(config) || 'web' !== config.output.target) return;
|
|
79
85
|
const currentConfig = chain.optimization.splitChunks.values();
|
|
80
86
|
if (!isPlainObject(currentConfig)) return;
|
|
81
87
|
const extraGroups = {};
|
package/dist/index.js
CHANGED
|
@@ -37,13 +37,19 @@ class VueLoader15PitchFixPlugin {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
const isPlainObject = (obj)=>null !== obj && 'object' == typeof obj && '[object Object]' === Object.prototype.toString.call(obj);
|
|
40
|
+
const isDefaultPreset = (config)=>{
|
|
41
|
+
const { performance, splitChunks } = config;
|
|
42
|
+
if (performance.chunkSplit && 'object' == typeof splitChunks && 0 === Object.keys(splitChunks).length) return performance.chunkSplit?.strategy === 'split-by-experience';
|
|
43
|
+
if ('object' == typeof splitChunks) return !splitChunks.preset || 'default' === splitChunks.preset;
|
|
44
|
+
return false;
|
|
45
|
+
};
|
|
40
46
|
const applySplitChunksRule = (api, options = {
|
|
41
47
|
vue: true,
|
|
42
48
|
router: true
|
|
43
49
|
})=>{
|
|
44
50
|
api.modifyBundlerChain((chain, { environment })=>{
|
|
45
51
|
const { config } = environment;
|
|
46
|
-
if ('
|
|
52
|
+
if (!isDefaultPreset(config) || 'web' !== config.output.target) return;
|
|
47
53
|
const currentConfig = chain.optimization.splitChunks.values();
|
|
48
54
|
if (!isPlainObject(currentConfig)) return;
|
|
49
55
|
const extraGroups = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-vue2",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"repository": "https://github.com/rstackjs/rsbuild-plugin-vue2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@biomejs/biome": "^1.9.4",
|
|
43
43
|
"@playwright/test": "^1.57.0",
|
|
44
|
-
"@rsbuild/core": "
|
|
45
|
-
"@rsbuild/plugin-less": "1.
|
|
44
|
+
"@rsbuild/core": "2.0.0-beta.0",
|
|
45
|
+
"@rsbuild/plugin-less": "^1.6.0",
|
|
46
46
|
"@rslib/core": "^0.18.2",
|
|
47
47
|
"@types/node": "^22.19.1",
|
|
48
48
|
"nano-staged": "^0.9.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"vue": "^2.7.16"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@rsbuild/core": "1.
|
|
55
|
+
"@rsbuild/core": "^1.0.0 || ^2.0.0-0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependenciesMeta": {
|
|
58
58
|
"@rsbuild/core": {
|