@rsbuild/plugin-vue 0.0.16 → 0.0.18
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 +8 -5
- package/dist/index.js +3 -1
- package/dist/index.mjs +54 -0
- package/package.json +6 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { RsbuildPlugin, RsbuildPluginAPI } from '@rsbuild/core';
|
|
2
|
+
import { VueLoaderOptions } from 'vue-loader';
|
|
3
|
+
|
|
4
|
+
type PluginVueOptions = {
|
|
5
|
+
vueLoaderOptions?: VueLoaderOptions;
|
|
5
6
|
};
|
|
6
|
-
|
|
7
|
+
declare function pluginVue(options?: PluginVueOptions): RsbuildPlugin<RsbuildPluginAPI>;
|
|
8
|
+
|
|
9
|
+
export { PluginVueOptions, pluginVue };
|
package/dist/index.js
CHANGED
|
@@ -26,6 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
29
31
|
var src_exports = {};
|
|
30
32
|
__export(src_exports, {
|
|
31
33
|
pluginVue: () => pluginVue
|
|
@@ -36,7 +38,7 @@ var import_vue_loader = require("vue-loader");
|
|
|
36
38
|
function pluginVue(options = {}) {
|
|
37
39
|
return {
|
|
38
40
|
name: "plugin-vue",
|
|
39
|
-
|
|
41
|
+
setup(api) {
|
|
40
42
|
api.modifyRsbuildConfig((config, { mergeRsbuildConfig }) => {
|
|
41
43
|
return mergeRsbuildConfig(config, {
|
|
42
44
|
source: {
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined")
|
|
5
|
+
return require.apply(this, arguments);
|
|
6
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
// ../../node_modules/.pnpm/@modern-js+module-tools@2.39.2_typescript@5.2.2/node_modules/@modern-js/module-tools/shims/esm.js
|
|
10
|
+
import { fileURLToPath } from "url";
|
|
11
|
+
import path from "path";
|
|
12
|
+
|
|
13
|
+
// ../../scripts/require_shims.js
|
|
14
|
+
import { createRequire } from "module";
|
|
15
|
+
global.require = createRequire(import.meta.url);
|
|
16
|
+
|
|
17
|
+
// src/index.ts
|
|
18
|
+
import { deepmerge } from "@rsbuild/shared/deepmerge";
|
|
19
|
+
import { VueLoaderPlugin } from "vue-loader";
|
|
20
|
+
function pluginVue(options = {}) {
|
|
21
|
+
return {
|
|
22
|
+
name: "plugin-vue",
|
|
23
|
+
setup(api) {
|
|
24
|
+
api.modifyRsbuildConfig((config, { mergeRsbuildConfig }) => {
|
|
25
|
+
return mergeRsbuildConfig(config, {
|
|
26
|
+
source: {
|
|
27
|
+
define: {
|
|
28
|
+
// https://link.vuejs.org/feature-flags
|
|
29
|
+
__VUE_OPTIONS_API__: true,
|
|
30
|
+
__VUE_PROD_DEVTOOLS__: false
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
api.modifyBundlerChain(async (chain, { CHAIN_ID }) => {
|
|
36
|
+
chain.resolve.extensions.add(".vue");
|
|
37
|
+
const vueLoaderOptions = deepmerge(
|
|
38
|
+
{
|
|
39
|
+
compilerOptions: {
|
|
40
|
+
preserveWhitespace: false
|
|
41
|
+
},
|
|
42
|
+
experimentalInlineMatchResource: true
|
|
43
|
+
},
|
|
44
|
+
options.vueLoaderOptions ?? {}
|
|
45
|
+
);
|
|
46
|
+
chain.module.rule(CHAIN_ID.RULE.VUE).test(/\.vue$/).use(CHAIN_ID.USE.VUE).loader(__require.resolve("vue-loader")).options(vueLoaderOptions);
|
|
47
|
+
chain.plugin(CHAIN_ID.PLUGIN.VUE_LOADER_PLUGIN).use(VueLoaderPlugin);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
pluginVue
|
|
54
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-vue",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"description": "Vue 3 plugin of Rsbuild",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"repository": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.mjs",
|
|
15
16
|
"default": "./dist/index.js"
|
|
16
17
|
}
|
|
17
18
|
},
|
|
@@ -23,16 +24,16 @@
|
|
|
23
24
|
"dependencies": {
|
|
24
25
|
"vue-loader": "^17.2.2",
|
|
25
26
|
"webpack": "^5.89.0",
|
|
26
|
-
"@rsbuild/shared": "0.0.
|
|
27
|
+
"@rsbuild/shared": "0.0.18"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
30
|
"typescript": "^5.2.2",
|
|
30
31
|
"webpack": "^5.89.0",
|
|
31
|
-
"@rsbuild/core": "0.0.
|
|
32
|
-
"@rsbuild/test-helper": "0.0.
|
|
32
|
+
"@rsbuild/core": "0.0.18",
|
|
33
|
+
"@rsbuild/test-helper": "0.0.18"
|
|
33
34
|
},
|
|
34
35
|
"peerDependencies": {
|
|
35
|
-
"@rsbuild/core": "^0.0.
|
|
36
|
+
"@rsbuild/core": "^0.0.18"
|
|
36
37
|
},
|
|
37
38
|
"publishConfig": {
|
|
38
39
|
"access": "public",
|