@rsbuild/plugin-vue 1.2.0 → 1.2.2

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/README.md CHANGED
@@ -7,7 +7,7 @@ An Rsbuild plugin to provide support for Vue 3.
7
7
  <img src="https://img.shields.io/npm/v/@rsbuild/plugin-vue?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" />
8
8
  </a>
9
9
  <img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="license" />
10
- <a href="https://npmcharts.com/compare/@rsbuild/plugin-vue?minimal=true"><img src="https://img.shields.io/npm/dm/@rsbuild/plugin-vue.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="downloads" /></a>
10
+ <a href="https://npmcharts.com/compare/@rsbuild/plugin-vue"><img src="https://img.shields.io/npm/dm/@rsbuild/plugin-vue.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="downloads" /></a>
11
11
  </p>
12
12
 
13
13
  ## Documentation
package/dist/index.cjs CHANGED
@@ -49,7 +49,7 @@ function pluginVue(options = {}) {
49
49
  return {
50
50
  name: PLUGIN_VUE_NAME,
51
51
  setup (api) {
52
- let VUE_REGEXP = /\.vue$/, CSS_MODULES_REGEX = /\.modules?\.\w+$/i;
52
+ let VUE_REGEXP = /\.vue$/, { test = VUE_REGEXP } = options, CSS_MODULES_REGEX = /\.modules?\.\w+$/i;
53
53
  api.modifyEnvironmentConfig((config, { mergeEnvironmentConfig })=>{
54
54
  let merged = mergeEnvironmentConfig({
55
55
  source: {
@@ -70,19 +70,20 @@ function pluginVue(options = {}) {
70
70
  preserveWhitespace: !1,
71
71
  ...userLoaderOptions.compilerOptions
72
72
  }, vueLoaderOptions = {
73
+ isServerBuild: 'rstest' !== api.context.callerName && void 0,
73
74
  experimentalInlineMatchResource: !0,
74
75
  ...userLoaderOptions,
75
76
  compilerOptions
76
77
  };
77
- chain.module.rule(CHAIN_ID.RULE.VUE).test(VUE_REGEXP).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(external_rspack_vue_loader_namespaceObject.VueLoaderPlugin);
78
+ 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(external_rspack_vue_loader_namespaceObject.VueLoaderPlugin);
78
79
  }), applySplitChunksRule(api, options.splitChunks);
79
80
  }
80
81
  };
81
82
  }
82
- for(var __webpack_i__ in exports.PLUGIN_VUE_NAME = __webpack_exports__.PLUGIN_VUE_NAME, exports.pluginVue = __webpack_exports__.pluginVue, __webpack_exports__)-1 === [
83
+ for(var __rspack_i in exports.PLUGIN_VUE_NAME = __webpack_exports__.PLUGIN_VUE_NAME, exports.pluginVue = __webpack_exports__.pluginVue, __webpack_exports__)-1 === [
83
84
  "PLUGIN_VUE_NAME",
84
85
  "pluginVue"
85
- ].indexOf(__webpack_i__) && (exports[__webpack_i__] = __webpack_exports__[__webpack_i__]);
86
+ ].indexOf(__rspack_i) && (exports[__rspack_i] = __webpack_exports__[__rspack_i]);
86
87
  Object.defineProperty(exports, '__esModule', {
87
88
  value: !0
88
89
  });
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { RsbuildPlugin } from '@rsbuild/core';
1
+ import type { RsbuildPlugin, Rspack } from '@rsbuild/core';
2
2
  import { type VueLoaderOptions } from 'rspack-vue-loader';
3
3
  export type SplitVueChunkOptions = {
4
4
  /**
@@ -13,6 +13,11 @@ export type SplitVueChunkOptions = {
13
13
  router?: boolean;
14
14
  };
15
15
  export type PluginVueOptions = {
16
+ /**
17
+ * Test condition to match Vue files.
18
+ * @default /\.vue$/
19
+ */
20
+ test?: Rspack.RuleSetCondition;
16
21
  /**
17
22
  * Options passed to `vue-loader`.
18
23
  * @see https://vue-loader.vuejs.org/
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ function pluginVue(options = {}) {
5
5
  return {
6
6
  name: PLUGIN_VUE_NAME,
7
7
  setup (api) {
8
- let VUE_REGEXP = /\.vue$/, CSS_MODULES_REGEX = /\.modules?\.\w+$/i;
8
+ let VUE_REGEXP = /\.vue$/, { test = VUE_REGEXP } = options, CSS_MODULES_REGEX = /\.modules?\.\w+$/i;
9
9
  api.modifyEnvironmentConfig((config, { mergeEnvironmentConfig })=>{
10
10
  let merged = mergeEnvironmentConfig({
11
11
  source: {
@@ -26,11 +26,12 @@ function pluginVue(options = {}) {
26
26
  preserveWhitespace: !1,
27
27
  ...userLoaderOptions.compilerOptions
28
28
  }, vueLoaderOptions = {
29
+ isServerBuild: 'rstest' !== api.context.callerName && void 0,
29
30
  experimentalInlineMatchResource: !0,
30
31
  ...userLoaderOptions,
31
32
  compilerOptions
32
33
  };
33
- chain.module.rule(CHAIN_ID.RULE.VUE).test(VUE_REGEXP).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);
34
+ 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);
34
35
  }), ((api, options = {
35
36
  vue: !0,
36
37
  router: !0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-vue",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Vue 3 plugin of Rsbuild",
5
5
  "homepage": "https://rsbuild.rs",
6
6
  "repository": {
@@ -24,14 +24,14 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "rspack-vue-loader": "^17.4.4",
27
- "webpack": "^5.102.1"
27
+ "webpack": "^5.103.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@rslib/core": "0.15.1",
31
- "@types/node": "^22.18.11",
30
+ "@rslib/core": "0.18.4",
31
+ "@types/node": "^24.10.4",
32
32
  "typescript": "^5.9.3",
33
- "vue": "^3.5.22",
34
- "@rsbuild/core": "1.6.0-beta.0",
33
+ "vue": "^3.5.25",
34
+ "@rsbuild/core": "1.6.14",
35
35
  "@scripts/test-helper": "1.0.1"
36
36
  },
37
37
  "peerDependencies": {