@rsbuild/plugin-vue 1.1.2 → 1.2.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,5 +1,5 @@
1
1
  "use strict";
2
- let __rslib_import_meta_url__ = 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
2
+ const __rslib_import_meta_url__ = 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
3
  var __webpack_require__ = {};
4
4
  __webpack_require__.d = (exports1, definition)=>{
5
5
  for(var key in definition)__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key) && Object.defineProperty(exports1, key, {
@@ -18,7 +18,7 @@ __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
- let external_node_module_namespaceObject = require("node:module"), external_vue_loader_namespaceObject = require("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), applySplitChunksRule = (api, options = {
22
22
  vue: !0,
23
23
  router: !0
24
24
  })=>{
@@ -30,7 +30,7 @@ let external_node_module_namespaceObject = require("node:module"), external_vue_
30
30
  let extraGroups = {};
31
31
  options.vue && (extraGroups.vue = {
32
32
  name: 'lib-vue',
33
- test: /node_modules[\\/](?:vue|vue-loader|@vue[\\/]shared|@vue[\\/]reactivity|@vue[\\/]runtime-dom|@vue[\\/]runtime-core)[\\/]/,
33
+ test: /node_modules[\\/](?:vue|rspack-vue-loader|@vue[\\/]shared|@vue[\\/]reactivity|@vue[\\/]runtime-dom|@vue[\\/]runtime-core)[\\/]/,
34
34
  priority: 0
35
35
  }), options.router && (extraGroups.router = {
36
36
  name: 'lib-router',
@@ -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: {
@@ -74,15 +74,15 @@ function pluginVue(options = {}) {
74
74
  ...userLoaderOptions,
75
75
  compilerOptions
76
76
  };
77
- chain.module.rule(CHAIN_ID.RULE.VUE).test(VUE_REGEXP).use(CHAIN_ID.USE.VUE).loader(src_require.resolve('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_vue_loader_namespaceObject.VueLoaderPlugin);
77
+ 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
78
  }), applySplitChunksRule(api, options.splitChunks);
79
79
  }
80
80
  };
81
81
  }
82
- for(var __webpack_i__ in exports.PLUGIN_VUE_NAME = __webpack_exports__.PLUGIN_VUE_NAME, exports.pluginVue = __webpack_exports__.pluginVue, __webpack_exports__)-1 === [
82
+ for(var __rspack_i in exports.PLUGIN_VUE_NAME = __webpack_exports__.PLUGIN_VUE_NAME, exports.pluginVue = __webpack_exports__.pluginVue, __webpack_exports__)-1 === [
83
83
  "PLUGIN_VUE_NAME",
84
84
  "pluginVue"
85
- ].indexOf(__webpack_i__) && (exports[__webpack_i__] = __webpack_exports__[__webpack_i__]);
85
+ ].indexOf(__rspack_i) && (exports[__rspack_i] = __webpack_exports__[__rspack_i]);
86
86
  Object.defineProperty(exports, '__esModule', {
87
87
  value: !0
88
88
  });
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { RsbuildPlugin } from '@rsbuild/core';
2
- import { type VueLoaderOptions } from 'vue-loader';
1
+ import type { RsbuildPlugin, Rspack } from '@rsbuild/core';
2
+ import { type VueLoaderOptions } from 'rspack-vue-loader';
3
3
  export type SplitVueChunkOptions = {
4
4
  /**
5
5
  * Whether to enable split chunking for Vue-related dependencies (e.g., vue, vue-loader).
@@ -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
@@ -1,11 +1,11 @@
1
1
  import { createRequire } from "node:module";
2
- import { VueLoaderPlugin } from "vue-loader";
2
+ import { VueLoaderPlugin } from "rspack-vue-loader";
3
3
  let src_require = createRequire(import.meta.url), PLUGIN_VUE_NAME = 'rsbuild:vue';
4
4
  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: {
@@ -30,7 +30,7 @@ function pluginVue(options = {}) {
30
30
  ...userLoaderOptions,
31
31
  compilerOptions
32
32
  };
33
- chain.module.rule(CHAIN_ID.RULE.VUE).test(VUE_REGEXP).use(CHAIN_ID.USE.VUE).loader(src_require.resolve('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);
33
+ 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
34
  }), ((api, options = {
35
35
  vue: !0,
36
36
  router: !0
@@ -43,7 +43,7 @@ function pluginVue(options = {}) {
43
43
  let extraGroups = {};
44
44
  options.vue && (extraGroups.vue = {
45
45
  name: 'lib-vue',
46
- test: /node_modules[\\/](?:vue|vue-loader|@vue[\\/]shared|@vue[\\/]reactivity|@vue[\\/]runtime-dom|@vue[\\/]runtime-core)[\\/]/,
46
+ test: /node_modules[\\/](?:vue|rspack-vue-loader|@vue[\\/]shared|@vue[\\/]reactivity|@vue[\\/]runtime-dom|@vue[\\/]runtime-core)[\\/]/,
47
47
  priority: 0
48
48
  }), options.router && (extraGroups.router = {
49
49
  name: 'lib-router',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-vue",
3
- "version": "1.1.2",
3
+ "version": "1.2.1",
4
4
  "description": "Vue 3 plugin of Rsbuild",
5
5
  "homepage": "https://rsbuild.rs",
6
6
  "repository": {
@@ -23,15 +23,15 @@
23
23
  "dist"
24
24
  ],
25
25
  "dependencies": {
26
- "vue-loader": "^17.4.2",
27
- "webpack": "^5.101.2"
26
+ "rspack-vue-loader": "^17.4.4",
27
+ "webpack": "^5.103.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@rslib/core": "0.12.1",
31
- "@types/node": "^22.17.2",
32
- "typescript": "^5.9.2",
33
- "vue": "^3.5.18",
34
- "@rsbuild/core": "1.5.0-rc.0",
30
+ "@rslib/core": "0.18.3",
31
+ "@types/node": "^24.10.1",
32
+ "typescript": "^5.9.3",
33
+ "vue": "^3.5.25",
34
+ "@rsbuild/core": "1.6.13",
35
35
  "@scripts/test-helper": "1.0.1"
36
36
  },
37
37
  "peerDependencies": {
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "scripts": {
45
45
  "build": "rslib build",
46
- "dev": "rslib build --watch",
46
+ "dev": "rslib build -w",
47
47
  "bump": "pnpx bumpp --no-tag"
48
48
  }
49
49
  }