@rsbuild/plugin-vue2 1.0.0-alpha.2 → 1.0.0-alpha.3

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
@@ -81,7 +81,6 @@ var VueLoader15PitchFixPlugin = class {
81
81
  };
82
82
 
83
83
  // src/splitChunks.ts
84
- var import_shared = require("@rsbuild/shared");
85
84
  var isPlainObject = (obj) => obj !== null && typeof obj === "object" && Object.prototype.toString.call(obj) === "[object Object]";
86
85
  var applySplitChunksRule = (api, options = {
87
86
  vue: true,
@@ -97,11 +96,19 @@ var applySplitChunksRule = (api, options = {
97
96
  return;
98
97
  }
99
98
  const extraGroups = {};
100
- if (options.vue) {
101
- extraGroups.vue = ["vue", "vue-loader"];
99
+ if (options.router) {
100
+ extraGroups.vue = {
101
+ name: "lib-vue",
102
+ test: /[\\/]node_modules[\\/](?:vue|vue-loader)[\\/]/,
103
+ priority: 0
104
+ };
102
105
  }
103
106
  if (options.router) {
104
- extraGroups.router = ["vue-router"];
107
+ extraGroups.router = {
108
+ name: "lib-router",
109
+ test: /[\\/]node_modules[\\/]vue-router[\\/]/,
110
+ priority: 0
111
+ };
105
112
  }
106
113
  if (!Object.keys(extraGroups).length) {
107
114
  return;
@@ -110,7 +117,7 @@ var applySplitChunksRule = (api, options = {
110
117
  ...currentConfig,
111
118
  cacheGroups: {
112
119
  ...currentConfig.cacheGroups,
113
- ...(0, import_shared.createCacheGroups)(extraGroups)
120
+ ...extraGroups
114
121
  }
115
122
  });
116
123
  });
@@ -144,7 +151,8 @@ function pluginVue2(options = {}) {
144
151
  }
145
152
  const userLoaderOptions = options.vueLoaderOptions ?? {};
146
153
  const compilerOptions = {
147
- preserveWhitespace: false,
154
+ // https://github.com/vuejs/vue-cli/pull/3853
155
+ whitespace: "condense",
148
156
  ...userLoaderOptions.compilerOptions
149
157
  };
150
158
  const vueLoaderOptions = {
package/dist/index.js CHANGED
@@ -62,7 +62,6 @@ var VueLoader15PitchFixPlugin = class {
62
62
  };
63
63
 
64
64
  // src/splitChunks.ts
65
- import { createCacheGroups } from "@rsbuild/shared";
66
65
  var isPlainObject = (obj) => obj !== null && typeof obj === "object" && Object.prototype.toString.call(obj) === "[object Object]";
67
66
  var applySplitChunksRule = (api, options = {
68
67
  vue: true,
@@ -78,11 +77,19 @@ var applySplitChunksRule = (api, options = {
78
77
  return;
79
78
  }
80
79
  const extraGroups = {};
81
- if (options.vue) {
82
- extraGroups.vue = ["vue", "vue-loader"];
80
+ if (options.router) {
81
+ extraGroups.vue = {
82
+ name: "lib-vue",
83
+ test: /[\\/]node_modules[\\/](?:vue|vue-loader)[\\/]/,
84
+ priority: 0
85
+ };
83
86
  }
84
87
  if (options.router) {
85
- extraGroups.router = ["vue-router"];
88
+ extraGroups.router = {
89
+ name: "lib-router",
90
+ test: /[\\/]node_modules[\\/]vue-router[\\/]/,
91
+ priority: 0
92
+ };
86
93
  }
87
94
  if (!Object.keys(extraGroups).length) {
88
95
  return;
@@ -91,7 +98,7 @@ var applySplitChunksRule = (api, options = {
91
98
  ...currentConfig,
92
99
  cacheGroups: {
93
100
  ...currentConfig.cacheGroups,
94
- ...createCacheGroups(extraGroups)
101
+ ...extraGroups
95
102
  }
96
103
  });
97
104
  });
@@ -125,7 +132,8 @@ function pluginVue2(options = {}) {
125
132
  }
126
133
  const userLoaderOptions = options.vueLoaderOptions ?? {};
127
134
  const compilerOptions = {
128
- preserveWhitespace: false,
135
+ // https://github.com/vuejs/vue-cli/pull/3853
136
+ whitespace: "condense",
129
137
  ...userLoaderOptions.compilerOptions
130
138
  };
131
139
  const vueLoaderOptions = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-vue2",
3
- "version": "1.0.0-alpha.2",
3
+ "version": "1.0.0-alpha.3",
4
4
  "description": "Vue 2 plugin of Rsbuild",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "repository": {
@@ -24,17 +24,16 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "vue-loader": "^15.11.1",
27
- "webpack": "^5.92.1",
28
- "@rsbuild/shared": "1.0.0-alpha.2"
27
+ "webpack": "^5.92.1"
29
28
  },
30
29
  "devDependencies": {
31
30
  "typescript": "^5.5.2",
32
31
  "webpack": "^5.92.1",
33
- "@rsbuild/core": "1.0.0-alpha.2",
34
- "@scripts/test-helper": "1.0.0-alpha.2"
32
+ "@rsbuild/core": "1.0.0-alpha.3",
33
+ "@scripts/test-helper": "1.0.0-alpha.3"
35
34
  },
36
35
  "peerDependencies": {
37
- "@rsbuild/core": "^1.0.0-alpha.2"
36
+ "@rsbuild/core": "^1.0.0-alpha.3"
38
37
  },
39
38
  "publishConfig": {
40
39
  "access": "public",