@rsbuild/plugin-vue2 1.0.6 → 1.1.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
3
- return 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
+ return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
4
4
  }();
5
5
  var __webpack_require__ = {};
6
6
  (()=>{
@@ -16,7 +16,7 @@ var __webpack_require__ = {};
16
16
  })();
17
17
  (()=>{
18
18
  __webpack_require__.r = (exports1)=>{
19
- if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
19
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
20
20
  value: 'Module'
21
21
  });
22
22
  Object.defineProperty(exports1, '__esModule', {
@@ -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) 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 ('split-by-experience' !== config.performance.chunkSplit.strategy) return;
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 = {};
@@ -156,10 +162,10 @@ function applyResolveConfig(vueRule, jsRule) {
156
162
  }
157
163
  exports.PLUGIN_VUE2_NAME = __webpack_exports__.PLUGIN_VUE2_NAME;
158
164
  exports.pluginVue2 = __webpack_exports__.pluginVue2;
159
- for(var __webpack_i__ in __webpack_exports__)if (-1 === [
165
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
160
166
  "PLUGIN_VUE2_NAME",
161
167
  "pluginVue2"
162
- ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
168
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
163
169
  Object.defineProperty(exports, '__esModule', {
164
170
  value: true
165
171
  });
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) 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 ('split-by-experience' !== config.performance.chunkSplit.strategy) return;
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.6",
3
+ "version": "1.1.1",
4
4
  "repository": "https://github.com/rstackjs/rsbuild-plugin-vue2",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -36,17 +36,17 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "vue-loader": "^15.11.1",
39
- "webpack": "^5.103.0"
39
+ "webpack": "^5.104.1"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@biomejs/biome": "^1.9.4",
43
- "@playwright/test": "^1.57.0",
44
- "@rsbuild/core": "^1.6.10",
45
- "@rsbuild/plugin-less": "1.5.0",
46
- "@rslib/core": "^0.18.2",
47
- "@types/node": "^22.19.1",
43
+ "@playwright/test": "^1.58.1",
44
+ "@rsbuild/core": "2.0.0-beta.0",
45
+ "@rsbuild/plugin-less": "^1.6.0",
46
+ "@rslib/core": "^0.19.4",
47
+ "@types/node": "^24.10.9",
48
48
  "nano-staged": "^0.9.0",
49
- "playwright": "^1.57.0",
49
+ "playwright": "^1.58.1",
50
50
  "simple-git-hooks": "^2.13.1",
51
51
  "typescript": "^5.9.3",
52
52
  "vue": "^2.7.16"
@@ -59,7 +59,7 @@
59
59
  "optional": true
60
60
  }
61
61
  },
62
- "packageManager": "pnpm@10.24.0",
62
+ "packageManager": "pnpm@10.28.2",
63
63
  "publishConfig": {
64
64
  "access": "public",
65
65
  "registry": "https://registry.npmjs.org/"