@rsbuild/plugin-vue2 0.6.5 → 0.6.7

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.js CHANGED
@@ -41,42 +41,6 @@ module.exports = __toCommonJS(src_exports);
41
41
  var import_shared2 = require("@rsbuild/shared");
42
42
  var import_vue_loader = require("vue-loader");
43
43
 
44
- // src/splitChunks.ts
45
- var import_shared = require("@rsbuild/shared");
46
- var applySplitChunksRule = (api, options = {
47
- vue: true,
48
- router: true
49
- }) => {
50
- api.modifyBundlerChain((chain) => {
51
- const config = api.getNormalizedConfig();
52
- if (config.performance.chunkSplit.strategy !== "split-by-experience") {
53
- return;
54
- }
55
- const currentConfig = chain.optimization.splitChunks.values();
56
- if (!(0, import_shared.isPlainObject)(currentConfig)) {
57
- return;
58
- }
59
- const extraGroups = {};
60
- if (options.vue) {
61
- extraGroups.vue = ["vue", "vue-loader"];
62
- }
63
- if (options.router) {
64
- extraGroups.router = ["vue-router"];
65
- }
66
- if (!Object.keys(extraGroups).length) {
67
- return;
68
- }
69
- chain.optimization.splitChunks({
70
- ...currentConfig,
71
- // @ts-expect-error Rspack and Webpack uses different cacheGroups type
72
- cacheGroups: {
73
- ...currentConfig.cacheGroups,
74
- ...(0, import_shared.createCacheGroups)(extraGroups)
75
- }
76
- });
77
- });
78
- };
79
-
80
44
  // src/VueLoader15PitchFixPlugin.ts
81
45
  var VueLoader15PitchFixPlugin = class {
82
46
  constructor() {
@@ -116,6 +80,42 @@ var VueLoader15PitchFixPlugin = class {
116
80
  }
117
81
  };
118
82
 
83
+ // src/splitChunks.ts
84
+ var import_shared = require("@rsbuild/shared");
85
+ var applySplitChunksRule = (api, options = {
86
+ vue: true,
87
+ router: true
88
+ }) => {
89
+ api.modifyBundlerChain((chain) => {
90
+ const config = api.getNormalizedConfig();
91
+ if (config.performance.chunkSplit.strategy !== "split-by-experience") {
92
+ return;
93
+ }
94
+ const currentConfig = chain.optimization.splitChunks.values();
95
+ if (!(0, import_shared.isPlainObject)(currentConfig)) {
96
+ return;
97
+ }
98
+ const extraGroups = {};
99
+ if (options.vue) {
100
+ extraGroups.vue = ["vue", "vue-loader"];
101
+ }
102
+ if (options.router) {
103
+ extraGroups.router = ["vue-router"];
104
+ }
105
+ if (!Object.keys(extraGroups).length) {
106
+ return;
107
+ }
108
+ chain.optimization.splitChunks({
109
+ ...currentConfig,
110
+ // @ts-expect-error Rspack and Webpack uses different cacheGroups type
111
+ cacheGroups: {
112
+ ...currentConfig.cacheGroups,
113
+ ...(0, import_shared.createCacheGroups)(extraGroups)
114
+ }
115
+ });
116
+ });
117
+ };
118
+
119
119
  // src/index.ts
120
120
  function pluginVue2(options = {}) {
121
121
  return {
package/dist/index.mjs CHANGED
@@ -15,7 +15,7 @@ var __publicField = (obj, key, value) => {
15
15
  return value;
16
16
  };
17
17
 
18
- // ../../node_modules/.pnpm/@modern-js+module-tools@2.49.0_eslint@8.57.0_typescript@5.4.5/node_modules/@modern-js/module-tools/shims/esm.js
18
+ // ../../node_modules/.pnpm/@modern-js+module-tools@2.49.1_eslint@8.57.0_typescript@5.4.5/node_modules/@modern-js/module-tools/shims/esm.js
19
19
  import { fileURLToPath } from "url";
20
20
  import path from "path";
21
21
 
@@ -23,45 +23,6 @@ import path from "path";
23
23
  import { deepmerge } from "@rsbuild/shared";
24
24
  import { VueLoaderPlugin } from "vue-loader";
25
25
 
26
- // src/splitChunks.ts
27
- import {
28
- isPlainObject,
29
- createCacheGroups
30
- } from "@rsbuild/shared";
31
- var applySplitChunksRule = (api, options = {
32
- vue: true,
33
- router: true
34
- }) => {
35
- api.modifyBundlerChain((chain) => {
36
- const config = api.getNormalizedConfig();
37
- if (config.performance.chunkSplit.strategy !== "split-by-experience") {
38
- return;
39
- }
40
- const currentConfig = chain.optimization.splitChunks.values();
41
- if (!isPlainObject(currentConfig)) {
42
- return;
43
- }
44
- const extraGroups = {};
45
- if (options.vue) {
46
- extraGroups.vue = ["vue", "vue-loader"];
47
- }
48
- if (options.router) {
49
- extraGroups.router = ["vue-router"];
50
- }
51
- if (!Object.keys(extraGroups).length) {
52
- return;
53
- }
54
- chain.optimization.splitChunks({
55
- ...currentConfig,
56
- // @ts-expect-error Rspack and Webpack uses different cacheGroups type
57
- cacheGroups: {
58
- ...currentConfig.cacheGroups,
59
- ...createCacheGroups(extraGroups)
60
- }
61
- });
62
- });
63
- };
64
-
65
26
  // src/VueLoader15PitchFixPlugin.ts
66
27
  var VueLoader15PitchFixPlugin = class {
67
28
  constructor() {
@@ -101,6 +62,45 @@ var VueLoader15PitchFixPlugin = class {
101
62
  }
102
63
  };
103
64
 
65
+ // src/splitChunks.ts
66
+ import {
67
+ createCacheGroups,
68
+ isPlainObject
69
+ } from "@rsbuild/shared";
70
+ var applySplitChunksRule = (api, options = {
71
+ vue: true,
72
+ router: true
73
+ }) => {
74
+ api.modifyBundlerChain((chain) => {
75
+ const config = api.getNormalizedConfig();
76
+ if (config.performance.chunkSplit.strategy !== "split-by-experience") {
77
+ return;
78
+ }
79
+ const currentConfig = chain.optimization.splitChunks.values();
80
+ if (!isPlainObject(currentConfig)) {
81
+ return;
82
+ }
83
+ const extraGroups = {};
84
+ if (options.vue) {
85
+ extraGroups.vue = ["vue", "vue-loader"];
86
+ }
87
+ if (options.router) {
88
+ extraGroups.router = ["vue-router"];
89
+ }
90
+ if (!Object.keys(extraGroups).length) {
91
+ return;
92
+ }
93
+ chain.optimization.splitChunks({
94
+ ...currentConfig,
95
+ // @ts-expect-error Rspack and Webpack uses different cacheGroups type
96
+ cacheGroups: {
97
+ ...currentConfig.cacheGroups,
98
+ ...createCacheGroups(extraGroups)
99
+ }
100
+ });
101
+ });
102
+ };
103
+
104
104
  // src/index.ts
105
105
  function pluginVue2(options = {}) {
106
106
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-vue2",
3
- "version": "0.6.5",
3
+ "version": "0.6.7",
4
4
  "description": "Vue 2 plugin of Rsbuild",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "repository": {
@@ -25,16 +25,16 @@
25
25
  "dependencies": {
26
26
  "vue-loader": "^15.11.1",
27
27
  "webpack": "^5.91.0",
28
- "@rsbuild/shared": "0.6.5"
28
+ "@rsbuild/shared": "0.6.7"
29
29
  },
30
30
  "devDependencies": {
31
31
  "typescript": "^5.4.2",
32
32
  "webpack": "^5.91.0",
33
- "@rsbuild/core": "0.6.5",
34
- "@scripts/test-helper": "0.6.5"
33
+ "@rsbuild/core": "0.6.7",
34
+ "@scripts/test-helper": "0.6.7"
35
35
  },
36
36
  "peerDependencies": {
37
- "@rsbuild/core": "^0.6.5"
37
+ "@rsbuild/core": "^0.6.7"
38
38
  },
39
39
  "publishConfig": {
40
40
  "access": "public",