@rsbuild/plugin-vue 1.0.7 → 1.1.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/README.md CHANGED
@@ -12,7 +12,7 @@ An Rsbuild plugin to provide support for Vue 3.
12
12
 
13
13
  ## Documentation
14
14
 
15
- See [Documentation](https://rsbuild.dev/plugins/list/plugin-vue).
15
+ See [Documentation](https://rsbuild.rs/plugins/list/plugin-vue).
16
16
 
17
17
  ## License
18
18
 
package/dist/index.cjs CHANGED
@@ -1,14 +1,12 @@
1
1
  "use strict";
2
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;
3
3
  var __webpack_require__ = {};
4
- __webpack_require__.d = function(exports1, definition) {
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, {
6
6
  enumerable: !0,
7
7
  get: definition[key]
8
8
  });
9
- }, __webpack_require__.o = function(obj, prop) {
10
- return Object.prototype.hasOwnProperty.call(obj, prop);
11
- }, __webpack_require__.r = function(exports1) {
9
+ }, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports1)=>{
12
10
  'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports1, Symbol.toStringTag, {
13
11
  value: 'Module'
14
12
  }), Object.defineProperty(exports1, '__esModule', {
@@ -17,8 +15,8 @@ __webpack_require__.d = function(exports1, definition) {
17
15
  };
18
16
  var __webpack_exports__ = {};
19
17
  __webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_exports__, {
20
- pluginVue: ()=>pluginVue,
21
- PLUGIN_VUE_NAME: ()=>PLUGIN_VUE_NAME
18
+ PLUGIN_VUE_NAME: ()=>PLUGIN_VUE_NAME,
19
+ pluginVue: ()=>pluginVue
22
20
  });
23
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 = {
24
22
  vue: !0,
@@ -65,7 +63,7 @@ function pluginVue(options = {}) {
65
63
  ]
66
64
  }
67
65
  }, config);
68
- return !0 === merged.output.cssModules.auto && (merged.output.cssModules.auto = (path, query)=>VUE_REGEXP.test(path) ? query.includes('type=style') && query.includes('module=true') : CSS_MODULES_REGEX.test(path)), merged;
66
+ return !0 === merged.output.cssModules.auto && (merged.output.cssModules.auto = (path, query)=>VUE_REGEXP.test(path) || path.includes('.vue.css') ? query.includes('type=style') && query.includes('module=true') : CSS_MODULES_REGEX.test(path)), merged;
69
67
  }), api.modifyBundlerChain(async (chain, { CHAIN_ID })=>{
70
68
  chain.resolve.extensions.add('.vue');
71
69
  let userLoaderOptions = options.vueLoaderOptions ?? {}, compilerOptions = {
@@ -81,8 +79,10 @@ function pluginVue(options = {}) {
81
79
  }
82
80
  };
83
81
  }
84
- var __webpack_export_target__ = exports;
85
- for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
86
- __webpack_exports__.__esModule && Object.defineProperty(__webpack_export_target__, '__esModule', {
82
+ for(var __webpack_i__ in exports.PLUGIN_VUE_NAME = __webpack_exports__.PLUGIN_VUE_NAME, exports.pluginVue = __webpack_exports__.pluginVue, __webpack_exports__)-1 === [
83
+ "PLUGIN_VUE_NAME",
84
+ "pluginVue"
85
+ ].indexOf(__webpack_i__) && (exports[__webpack_i__] = __webpack_exports__[__webpack_i__]);
86
+ Object.defineProperty(exports, '__esModule', {
87
87
  value: !0
88
88
  });
package/dist/index.js CHANGED
@@ -1,32 +1,6 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module";
2
- import * as __WEBPACK_EXTERNAL_MODULE_vue_loader_a33e643c__ from "vue-loader";
3
- let isPlainObject = (obj)=>null !== obj && 'object' == typeof obj && '[object Object]' === Object.prototype.toString.call(obj), 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 (!isPlainObject(currentConfig)) return;
12
- let extraGroups = {};
13
- options.vue && (extraGroups.vue = {
14
- name: 'lib-vue',
15
- test: /node_modules[\\/](?:vue|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
- }, src_require = (0, __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__.createRequire)(import.meta.url), PLUGIN_VUE_NAME = 'rsbuild:vue';
1
+ import { createRequire } from "node:module";
2
+ import { VueLoaderPlugin } from "vue-loader";
3
+ let src_require = createRequire(import.meta.url), PLUGIN_VUE_NAME = 'rsbuild:vue';
30
4
  function pluginVue(options = {}) {
31
5
  return {
32
6
  name: PLUGIN_VUE_NAME,
@@ -45,7 +19,7 @@ function pluginVue(options = {}) {
45
19
  ]
46
20
  }
47
21
  }, config);
48
- return !0 === merged.output.cssModules.auto && (merged.output.cssModules.auto = (path, query)=>VUE_REGEXP.test(path) ? query.includes('type=style') && query.includes('module=true') : CSS_MODULES_REGEX.test(path)), merged;
22
+ return !0 === merged.output.cssModules.auto && (merged.output.cssModules.auto = (path, query)=>VUE_REGEXP.test(path) || path.includes('.vue.css') ? query.includes('type=style') && query.includes('module=true') : CSS_MODULES_REGEX.test(path)), merged;
49
23
  }), api.modifyBundlerChain(async (chain, { CHAIN_ID })=>{
50
24
  chain.resolve.extensions.add('.vue');
51
25
  let userLoaderOptions = options.vueLoaderOptions ?? {}, compilerOptions = {
@@ -56,8 +30,34 @@ function pluginVue(options = {}) {
56
30
  ...userLoaderOptions,
57
31
  compilerOptions
58
32
  };
59
- 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(__WEBPACK_EXTERNAL_MODULE_vue_loader_a33e643c__.VueLoaderPlugin);
60
- }), applySplitChunksRule(api, options.splitChunks);
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);
34
+ }), ((api, options = {
35
+ vue: !0,
36
+ router: !0
37
+ })=>{
38
+ api.modifyBundlerChain((chain, { environment })=>{
39
+ let { config } = environment;
40
+ if ('split-by-experience' !== config.performance.chunkSplit.strategy) return;
41
+ let currentConfig = chain.optimization.splitChunks.values();
42
+ if (null === currentConfig || 'object' != typeof currentConfig || '[object Object]' !== Object.prototype.toString.call(currentConfig)) return;
43
+ let extraGroups = {};
44
+ options.vue && (extraGroups.vue = {
45
+ name: 'lib-vue',
46
+ test: /node_modules[\\/](?:vue|vue-loader|@vue[\\/]shared|@vue[\\/]reactivity|@vue[\\/]runtime-dom|@vue[\\/]runtime-core)[\\/]/,
47
+ priority: 0
48
+ }), options.router && (extraGroups.router = {
49
+ name: 'lib-router',
50
+ test: /node_modules[\\/]vue-router[\\/]/,
51
+ priority: 0
52
+ }), Object.keys(extraGroups).length && chain.optimization.splitChunks({
53
+ ...currentConfig,
54
+ cacheGroups: {
55
+ ...extraGroups,
56
+ ...currentConfig.cacheGroups
57
+ }
58
+ });
59
+ });
60
+ })(api, options.splitChunks);
61
61
  }
62
62
  };
63
63
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-vue",
3
- "version": "1.0.7",
3
+ "version": "1.1.1",
4
4
  "description": "Vue 3 plugin of Rsbuild",
5
- "homepage": "https://rsbuild.dev",
5
+ "homepage": "https://rsbuild.rs",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/web-infra-dev/rsbuild",
@@ -24,15 +24,14 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "vue-loader": "^17.4.2",
27
- "webpack": "^5.98.0"
27
+ "webpack": "^5.101.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@rslib/core": "0.5.2",
31
- "@types/node": "^22.13.8",
32
- "typescript": "^5.8.2",
33
- "vue": "^3.5.13",
34
- "webpack": "^5.98.0",
35
- "@rsbuild/core": "1.2.16",
30
+ "@rslib/core": "0.11.1",
31
+ "@types/node": "^22.17.0",
32
+ "typescript": "^5.9.2",
33
+ "vue": "^3.5.18",
34
+ "@rsbuild/core": "1.4.14",
36
35
  "@scripts/test-helper": "1.0.1"
37
36
  },
38
37
  "peerDependencies": {
@@ -40,11 +39,11 @@
40
39
  },
41
40
  "publishConfig": {
42
41
  "access": "public",
43
- "provenance": true,
44
42
  "registry": "https://registry.npmjs.org/"
45
43
  },
46
44
  "scripts": {
47
45
  "build": "rslib build",
48
- "dev": "rslib build --watch"
46
+ "dev": "rslib build --watch",
47
+ "bump": "npx bumpp --no-tag"
49
48
  }
50
49
  }