@rsbuild/plugin-vue2 1.0.4 → 1.0.6

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
@@ -46,12 +46,10 @@ class VueLoader15PitchFixPlugin {
46
46
  apply(compiler) {
47
47
  const { NormalModule } = compiler.webpack;
48
48
  compiler.hooks.compilation.tap(this.name, (compilation)=>{
49
- var _compilation_compiler_options_experiments, _compilation_compiler_options;
50
- const isExpCssOn = null == (_compilation_compiler_options = compilation.compiler.options) ? void 0 : null == (_compilation_compiler_options_experiments = _compilation_compiler_options.experiments) ? void 0 : _compilation_compiler_options_experiments.css;
49
+ const isExpCssOn = compilation.compiler.options?.experiments?.css;
51
50
  if (!isExpCssOn) return;
52
51
  NormalModule.getCompilationHooks(compilation).loader.tap(this.name, (loaderContext)=>{
53
- var _loaderContext_loaders_, _loaderContext_loaders;
54
- if (/[?&]type=style/.test(loaderContext.resourceQuery) && /[\\/]vue-loader[\\/]lib[\\/]loaders[\\/]pitcher/.test((null == (_loaderContext_loaders = loaderContext.loaders) ? void 0 : null == (_loaderContext_loaders_ = _loaderContext_loaders[0]) ? void 0 : _loaderContext_loaders_.path) || '')) {
52
+ if (/[?&]type=style/.test(loaderContext.resourceQuery) && /[\\/]vue-loader[\\/]lib[\\/]loaders[\\/]pitcher/.test(loaderContext.loaders?.[0]?.path || '')) {
55
53
  const seen = new Set();
56
54
  const loaders = [];
57
55
  for (const loader of loaderContext.loaders || []){
@@ -111,7 +109,10 @@ function pluginVue2(options = {}) {
111
109
  const CSS_MODULES_REGEX = /\.modules?\.\w+$/i;
112
110
  api.modifyEnvironmentConfig((config, { mergeEnvironmentConfig })=>{
113
111
  if (true === config.output.cssModules.auto) config.output.cssModules.auto = (path, query)=>{
114
- if (VUE_REGEXP.test(path)) return query.includes('type=style') && query.includes('module=true');
112
+ if (VUE_REGEXP.test(path)) {
113
+ const params = new URLSearchParams(query || '');
114
+ return 'style' === params.get('type') && params.has('module');
115
+ }
115
116
  return CSS_MODULES_REGEX.test(path);
116
117
  };
117
118
  const extraConfig = {
package/dist/index.js CHANGED
@@ -14,12 +14,10 @@ class VueLoader15PitchFixPlugin {
14
14
  apply(compiler) {
15
15
  const { NormalModule } = compiler.webpack;
16
16
  compiler.hooks.compilation.tap(this.name, (compilation)=>{
17
- var _compilation_compiler_options_experiments, _compilation_compiler_options;
18
- const isExpCssOn = null == (_compilation_compiler_options = compilation.compiler.options) ? void 0 : null == (_compilation_compiler_options_experiments = _compilation_compiler_options.experiments) ? void 0 : _compilation_compiler_options_experiments.css;
17
+ const isExpCssOn = compilation.compiler.options?.experiments?.css;
19
18
  if (!isExpCssOn) return;
20
19
  NormalModule.getCompilationHooks(compilation).loader.tap(this.name, (loaderContext)=>{
21
- var _loaderContext_loaders_, _loaderContext_loaders;
22
- if (/[?&]type=style/.test(loaderContext.resourceQuery) && /[\\/]vue-loader[\\/]lib[\\/]loaders[\\/]pitcher/.test((null == (_loaderContext_loaders = loaderContext.loaders) ? void 0 : null == (_loaderContext_loaders_ = _loaderContext_loaders[0]) ? void 0 : _loaderContext_loaders_.path) || '')) {
20
+ if (/[?&]type=style/.test(loaderContext.resourceQuery) && /[\\/]vue-loader[\\/]lib[\\/]loaders[\\/]pitcher/.test(loaderContext.loaders?.[0]?.path || '')) {
23
21
  const seen = new Set();
24
22
  const loaders = [];
25
23
  for (const loader of loaderContext.loaders || []){
@@ -79,7 +77,10 @@ function pluginVue2(options = {}) {
79
77
  const CSS_MODULES_REGEX = /\.modules?\.\w+$/i;
80
78
  api.modifyEnvironmentConfig((config, { mergeEnvironmentConfig })=>{
81
79
  if (true === config.output.cssModules.auto) config.output.cssModules.auto = (path, query)=>{
82
- if (VUE_REGEXP.test(path)) return query.includes('type=style') && query.includes('module=true');
80
+ if (VUE_REGEXP.test(path)) {
81
+ const params = new URLSearchParams(query || '');
82
+ return 'style' === params.get('type') && params.has('module');
83
+ }
83
84
  return CSS_MODULES_REGEX.test(path);
84
85
  };
85
86
  const extraConfig = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-vue2",
3
- "version": "1.0.4",
4
- "repository": "https://github.com/rspack-contrib/rsbuild-plugin-vue2",
3
+ "version": "1.0.6",
4
+ "repository": "https://github.com/rstackjs/rsbuild-plugin-vue2",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "exports": {
@@ -36,30 +36,30 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "vue-loader": "^15.11.1",
39
- "webpack": "^5.101.0"
39
+ "webpack": "^5.103.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@biomejs/biome": "^1.9.4",
43
- "@playwright/test": "^1.54.1",
44
- "@rsbuild/core": "^1.4.12",
45
- "@rsbuild/plugin-less": "1.3.1",
46
- "@rslib/core": "^0.11.0",
47
- "@types/node": "^22.17.0",
48
- "nano-staged": "^0.8.0",
49
- "playwright": "^1.54.1",
43
+ "@playwright/test": "^1.57.0",
44
+ "@rsbuild/core": "^1.6.10",
45
+ "@rsbuild/plugin-less": "1.5.0",
46
+ "@rslib/core": "^0.18.2",
47
+ "@types/node": "^22.19.1",
48
+ "nano-staged": "^0.9.0",
49
+ "playwright": "^1.57.0",
50
50
  "simple-git-hooks": "^2.13.1",
51
- "typescript": "^5.9.2",
51
+ "typescript": "^5.9.3",
52
52
  "vue": "^2.7.16"
53
53
  },
54
54
  "peerDependencies": {
55
- "@rsbuild/core": "1.x"
55
+ "@rsbuild/core": "^1.0.0 || ^2.0.0-0"
56
56
  },
57
57
  "peerDependenciesMeta": {
58
58
  "@rsbuild/core": {
59
59
  "optional": true
60
60
  }
61
61
  },
62
- "packageManager": "pnpm@10.14.0",
62
+ "packageManager": "pnpm@10.24.0",
63
63
  "publishConfig": {
64
64
  "access": "public",
65
65
  "registry": "https://registry.npmjs.org/"