@rsbuild/plugin-vue2 0.0.0-nightly-20231019160847 → 0.0.0-nightly-20231021160812

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.d.ts CHANGED
@@ -1,16 +1,6 @@
1
- import type { RsbuildPlugin } from '@rsbuild/core';
2
- import type { RsbuildPluginAPI } from '@rsbuild/webpack';
1
+ import type { RsbuildPlugin, RsbuildPluginAPI } from '@rsbuild/core';
3
2
  import type { VueLoaderOptions } from 'vue-loader';
4
- type VueJSXPresetOptions = {
5
- compositionAPI?: boolean | string;
6
- functional?: boolean;
7
- injectH?: boolean;
8
- vModel?: boolean;
9
- vOn?: boolean;
10
- };
11
3
  export type PluginVueOptions = {
12
- vueJsxOptions?: VueJSXPresetOptions;
13
4
  vueLoaderOptions?: VueLoaderOptions;
14
5
  };
15
- export declare function pluginVue2(options?: PluginVueOptions): RsbuildPlugin<RsbuildPluginAPI>;
16
- export {};
6
+ export declare function pluginVue2(options?: PluginVueOptions): RsbuildPlugin<RsbuildPluginAPI>;
package/dist/index.js CHANGED
@@ -36,34 +36,7 @@ var import_vue_loader = require("vue-loader");
36
36
  function pluginVue2(options = {}) {
37
37
  return {
38
38
  name: "plugin-vue2",
39
- // Remove built-in react plugins.
40
- // These plugins should be moved to a separate package in the next major version.
41
- remove: ["plugin-react", "plugin-antd", "plugin-arco"],
42
39
  async setup(api) {
43
- api.modifyRsbuildConfig((config, { mergeRsbuildConfig }) => {
44
- const builderConfig = {
45
- output: {
46
- disableSvgr: true
47
- },
48
- tools: {
49
- babel(_, { addPresets }) {
50
- addPresets([
51
- [
52
- require.resolve("@vue/babel-preset-jsx"),
53
- {
54
- injectH: true,
55
- ...options.vueJsxOptions
56
- }
57
- ]
58
- ]);
59
- }
60
- }
61
- };
62
- if (api.context.bundlerType === "rspack") {
63
- builderConfig.output.disableCssExtract = true;
64
- }
65
- return mergeRsbuildConfig(config, builderConfig);
66
- });
67
40
  api.modifyBundlerChain(async (chain, { CHAIN_ID }) => {
68
41
  var _a;
69
42
  chain.resolve.extensions.add(".vue");
@@ -71,11 +44,22 @@ function pluginVue2(options = {}) {
71
44
  {
72
45
  compilerOptions: {
73
46
  preserveWhitespace: false
74
- }
47
+ },
48
+ experimentalInlineMatchResource: api.context.bundlerType === "rspack"
75
49
  },
76
50
  (_a = options.vueLoaderOptions) != null ? _a : {}
77
51
  );
78
52
  chain.module.rule(CHAIN_ID.RULE.VUE).test(/\.vue$/).use(CHAIN_ID.USE.VUE).loader(require.resolve("vue-loader")).options(vueLoaderOptions);
53
+ if (api.context.bundlerType === "rspack" && !chain.module.rules.has(CHAIN_ID.RULE.TS)) {
54
+ chain.module.rule(CHAIN_ID.RULE.TS).type("javascript/auto").test(/\.ts$/).use(CHAIN_ID.USE.SWC).loader("builtin:swc-loader").options({
55
+ sourceMap: true,
56
+ jsc: {
57
+ parser: {
58
+ syntax: "typescript"
59
+ }
60
+ }
61
+ });
62
+ }
79
63
  chain.plugin(CHAIN_ID.PLUGIN.VUE_LOADER_PLUGIN).use(import_vue_loader.VueLoaderPlugin);
80
64
  });
81
65
  }
package/package.json CHANGED
@@ -5,15 +5,15 @@
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/web-infra-dev/rsbuild",
8
- "directory": "packages/plugin-vue"
8
+ "directory": "packages/plugin-vue2"
9
9
  },
10
10
  "license": "MIT",
11
- "version": "0.0.0-nightly-20231019160847",
11
+ "version": "0.0.0-nightly-20231021160812",
12
12
  "types": "./dist/index.d.ts",
13
13
  "main": "./dist/index.js",
14
- "module": "./dist/index.js",
15
14
  "exports": {
16
15
  ".": {
16
+ "types": "./dist/index.d.ts",
17
17
  "default": "./dist/index.js"
18
18
  }
19
19
  },
@@ -21,27 +21,18 @@
21
21
  "dist"
22
22
  ],
23
23
  "dependencies": {
24
- "@vue/babel-preset-jsx": "^1.4.0",
25
- "vue-loader": "^15.10.1",
26
- "@rsbuild/shared": "0.0.0-nightly-20231019160847"
24
+ "vue-loader": "^15.11.1",
25
+ "@rsbuild/shared": "0.0.0-nightly-20231021160812"
27
26
  },
28
27
  "devDependencies": {
29
- "@babel/core": "^7.22.15",
30
28
  "typescript": "^5",
31
29
  "webpack": "^5.88.1",
32
- "@rsbuild/core": "0.0.0-nightly-20231019160847",
33
- "@rsbuild/webpack": "0.0.0-nightly-20231019160847"
30
+ "@rsbuild/core": "0.0.0-nightly-20231021160812",
31
+ "@rsbuild/test-helper": "0.0.0-nightly-20231021160812"
34
32
  },
35
33
  "peerDependencies": {
36
- "@rsbuild/core": "0.0.0-nightly-20231019160847",
37
- "@rsbuild/webpack": "0.0.0-nightly-20231019160847"
34
+ "@rsbuild/core": "0.0.0-nightly-20231021160812"
38
35
  },
39
- "peerDependenciesMeta": {
40
- "@rsbuild/webpack": {
41
- "optional": true
42
- }
43
- },
44
- "sideEffects": false,
45
36
  "publishConfig": {
46
37
  "registry": "https://registry.npmjs.org/",
47
38
  "access": "public",