@rsbuild/plugin-vue 1.2.3 → 2.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
@@ -18,10 +18,11 @@ __webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_expo
18
18
  PLUGIN_VUE_NAME: ()=>PLUGIN_VUE_NAME,
19
19
  pluginVue: ()=>pluginVue
20
20
  });
21
- const external_node_module_namespaceObject = require("node:module"), external_rspack_vue_loader_namespaceObject = require("rspack-vue-loader"), isPlainObject = (obj)=>null !== obj && 'object' == typeof obj && '[object Object]' === Object.prototype.toString.call(obj), applySplitChunksRule = (api, options = {
21
+ const external_node_module_namespaceObject = require("node:module"), external_rspack_vue_loader_namespaceObject = require("rspack-vue-loader"), isPlainObject = (obj)=>null !== obj && 'object' == typeof obj && '[object Object]' === Object.prototype.toString.call(obj);
22
+ function applySplitChunksRule(api, options = {
22
23
  vue: !0,
23
24
  router: !0
24
- })=>{
25
+ }) {
25
26
  api.modifyBundlerChain((chain, { environment })=>{
26
27
  let { config } = environment;
27
28
  if ('split-by-experience' !== config.performance.chunkSplit.strategy) return;
@@ -44,7 +45,8 @@ const external_node_module_namespaceObject = require("node:module"), external_rs
44
45
  }
45
46
  });
46
47
  });
47
- }, src_require = (0, external_node_module_namespaceObject.createRequire)(__rslib_import_meta_url__), PLUGIN_VUE_NAME = 'rsbuild:vue';
48
+ }
49
+ const src_require = (0, external_node_module_namespaceObject.createRequire)(__rslib_import_meta_url__), PLUGIN_VUE_NAME = 'rsbuild:vue';
48
50
  function pluginVue(options = {}) {
49
51
  return {
50
52
  name: PLUGIN_VUE_NAME,
package/dist/index.js CHANGED
@@ -1,5 +1,32 @@
1
1
  import { createRequire } from "node:module";
2
2
  import { VueLoaderPlugin } from "rspack-vue-loader";
3
+ function applySplitChunksRule(api, options = {
4
+ vue: !0,
5
+ router: !0
6
+ }) {
7
+ api.modifyBundlerChain((chain, { environment })=>{
8
+ let { config } = environment;
9
+ if ('split-by-experience' !== config.performance.chunkSplit.strategy) return;
10
+ let currentConfig = chain.optimization.splitChunks.values();
11
+ if (null === currentConfig || 'object' != typeof currentConfig || '[object Object]' !== Object.prototype.toString.call(currentConfig)) return;
12
+ let extraGroups = {};
13
+ options.vue && (extraGroups.vue = {
14
+ name: 'lib-vue',
15
+ test: /node_modules[\\/](?:vue|rspack-vue-loader|@vue[\\/]shared|@vue[\\/]reactivity|@vue[\\/]runtime-dom|@vue[\\/]runtime-core)[\\/]/,
16
+ priority: 0
17
+ }), options.router && (extraGroups.router = {
18
+ name: 'lib-router',
19
+ test: /node_modules[\\/]vue-router[\\/]/,
20
+ priority: 0
21
+ }), Object.keys(extraGroups).length && chain.optimization.splitChunks({
22
+ ...currentConfig,
23
+ cacheGroups: {
24
+ ...extraGroups,
25
+ ...currentConfig.cacheGroups
26
+ }
27
+ });
28
+ });
29
+ }
3
30
  let src_require = createRequire(import.meta.url), PLUGIN_VUE_NAME = 'rsbuild:vue';
4
31
  function pluginVue(options = {}) {
5
32
  return {
@@ -40,33 +67,7 @@ function pluginVue(options = {}) {
40
67
  compilerOptions
41
68
  };
42
69
  chain.module.rule(CHAIN_ID.RULE.VUE).test(test).use(CHAIN_ID.USE.VUE).loader(src_require.resolve('rspack-vue-loader')).options(vueLoaderOptions), chain.module.rule(CHAIN_ID.RULE.CSS).test(/\.(?:css|postcss|pcss)$/), chain.plugin(CHAIN_ID.PLUGIN.VUE_LOADER_PLUGIN).before(CHAIN_ID.PLUGIN.REACT_FAST_REFRESH).use(VueLoaderPlugin);
43
- }), ((api, options = {
44
- vue: !0,
45
- router: !0
46
- })=>{
47
- api.modifyBundlerChain((chain, { environment })=>{
48
- let { config } = environment;
49
- if ('split-by-experience' !== config.performance.chunkSplit.strategy) return;
50
- let currentConfig = chain.optimization.splitChunks.values();
51
- if (null === currentConfig || 'object' != typeof currentConfig || '[object Object]' !== Object.prototype.toString.call(currentConfig)) return;
52
- let extraGroups = {};
53
- options.vue && (extraGroups.vue = {
54
- name: 'lib-vue',
55
- test: /node_modules[\\/](?:vue|rspack-vue-loader|@vue[\\/]shared|@vue[\\/]reactivity|@vue[\\/]runtime-dom|@vue[\\/]runtime-core)[\\/]/,
56
- priority: 0
57
- }), options.router && (extraGroups.router = {
58
- name: 'lib-router',
59
- test: /node_modules[\\/]vue-router[\\/]/,
60
- priority: 0
61
- }), Object.keys(extraGroups).length && chain.optimization.splitChunks({
62
- ...currentConfig,
63
- cacheGroups: {
64
- ...extraGroups,
65
- ...currentConfig.cacheGroups
66
- }
67
- });
68
- });
69
- })(api, options.splitChunks);
70
+ }), applySplitChunksRule(api, options.splitChunks);
70
71
  }
71
72
  };
72
73
  }
@@ -1,3 +1,3 @@
1
1
  import type { RsbuildPluginAPI } from '@rsbuild/core';
2
2
  import type { SplitVueChunkOptions } from './index.js';
3
- export declare const applySplitChunksRule: (api: RsbuildPluginAPI, options?: SplitVueChunkOptions) => void;
3
+ export declare function applySplitChunksRule(api: RsbuildPluginAPI, options?: SplitVueChunkOptions): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-vue",
3
- "version": "1.2.3",
3
+ "version": "2.0.0-alpha.3",
4
4
  "description": "Vue 3 plugin of Rsbuild",
5
5
  "homepage": "https://rsbuild.rs",
6
6
  "repository": {
@@ -23,19 +23,19 @@
23
23
  "dist"
24
24
  ],
25
25
  "dependencies": {
26
- "rspack-vue-loader": "^17.4.4",
26
+ "rspack-vue-loader": "^17.4.5",
27
27
  "webpack": "^5.104.1"
28
28
  },
29
29
  "devDependencies": {
30
- "@rslib/core": "0.19.1",
31
- "@types/node": "^24.10.4",
30
+ "@rslib/core": "0.19.3",
31
+ "@types/node": "^24.10.9",
32
32
  "typescript": "^5.9.3",
33
- "vue": "^3.5.26",
33
+ "vue": "^3.5.27",
34
34
  "@scripts/test-helper": "1.0.1",
35
- "@rsbuild/core": "1.7.2"
35
+ "@rsbuild/core": "2.0.0-alpha.3"
36
36
  },
37
37
  "peerDependencies": {
38
- "@rsbuild/core": "^1.0.0 || ^2.0.0-0"
38
+ "@rsbuild/core": "^2.0.0-0"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public",