@rsbuild/plugin-vue2 0.0.0-nightly-20231020160758 → 0.0.0-nightly-20231022160828
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 +2 -12
- package/dist/index.js +12 -28
- package/package.json +7 -16
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 rsbuildConfig = {
|
|
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
|
-
rsbuildConfig.output.disableCssExtract = true;
|
|
64
|
-
}
|
|
65
|
-
return mergeRsbuildConfig(config, rsbuildConfig);
|
|
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,10 +5,10 @@
|
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/web-infra-dev/rsbuild",
|
|
8
|
-
"directory": "packages/plugin-
|
|
8
|
+
"directory": "packages/plugin-vue2"
|
|
9
9
|
},
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"version": "0.0.0-nightly-
|
|
11
|
+
"version": "0.0.0-nightly-20231022160828",
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
13
|
"main": "./dist/index.js",
|
|
14
14
|
"exports": {
|
|
@@ -21,26 +21,17 @@
|
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"@rsbuild/shared": "0.0.0-nightly-20231020160758"
|
|
24
|
+
"vue-loader": "^15.11.1",
|
|
25
|
+
"@rsbuild/shared": "0.0.0-nightly-20231022160828"
|
|
27
26
|
},
|
|
28
27
|
"devDependencies": {
|
|
29
|
-
"@babel/core": "^7.23.2",
|
|
30
28
|
"typescript": "^5",
|
|
31
29
|
"webpack": "^5.88.1",
|
|
32
|
-
"@rsbuild/core": "0.0.0-nightly-
|
|
33
|
-
"@rsbuild/
|
|
34
|
-
"@rsbuild/test-helper": "0.0.0-nightly-20231020160758"
|
|
30
|
+
"@rsbuild/core": "0.0.0-nightly-20231022160828",
|
|
31
|
+
"@rsbuild/test-helper": "0.0.0-nightly-20231022160828"
|
|
35
32
|
},
|
|
36
33
|
"peerDependencies": {
|
|
37
|
-
"@rsbuild/core": "0.0.0-nightly-
|
|
38
|
-
"@rsbuild/webpack": "0.0.0-nightly-20231020160758"
|
|
39
|
-
},
|
|
40
|
-
"peerDependenciesMeta": {
|
|
41
|
-
"@rsbuild/webpack": {
|
|
42
|
-
"optional": true
|
|
43
|
-
}
|
|
34
|
+
"@rsbuild/core": "0.0.0-nightly-20231022160828"
|
|
44
35
|
},
|
|
45
36
|
"publishConfig": {
|
|
46
37
|
"registry": "https://registry.npmjs.org/",
|