@rsbuild/plugin-vue2 0.0.17 → 0.0.19
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 +2 -0
- package/dist/index.mjs +43 -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 pluginVue2(options?: PluginVueOptions): RsbuildPlugin<RsbuildPluginAPI>;
|
|
8
|
+
|
|
9
|
+
export { PluginVueOptions, pluginVue2 };
|
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
|
pluginVue2: () => pluginVue2
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
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.40.0_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 pluginVue2(options = {}) {
|
|
21
|
+
return {
|
|
22
|
+
name: "plugin-vue2",
|
|
23
|
+
setup(api) {
|
|
24
|
+
api.modifyBundlerChain((chain, { CHAIN_ID }) => {
|
|
25
|
+
chain.resolve.extensions.add(".vue");
|
|
26
|
+
const vueLoaderOptions = deepmerge(
|
|
27
|
+
{
|
|
28
|
+
compilerOptions: {
|
|
29
|
+
preserveWhitespace: false
|
|
30
|
+
},
|
|
31
|
+
experimentalInlineMatchResource: true
|
|
32
|
+
},
|
|
33
|
+
options.vueLoaderOptions ?? {}
|
|
34
|
+
);
|
|
35
|
+
chain.module.rule(CHAIN_ID.RULE.VUE).test(/\.vue$/).use(CHAIN_ID.USE.VUE).loader(__require.resolve("vue-loader")).options(vueLoaderOptions);
|
|
36
|
+
chain.plugin(CHAIN_ID.PLUGIN.VUE_LOADER_PLUGIN).use(VueLoaderPlugin);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
pluginVue2
|
|
43
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-vue2",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"description": "Vue 2 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": "^15.11.1",
|
|
25
26
|
"webpack": "^5.89.0",
|
|
26
|
-
"@rsbuild/shared": "0.0.
|
|
27
|
+
"@rsbuild/shared": "0.0.19"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
30
|
"typescript": "^5.2.2",
|
|
30
31
|
"webpack": "^5.89.0",
|
|
31
|
-
"@rsbuild/
|
|
32
|
-
"@rsbuild/
|
|
32
|
+
"@rsbuild/core": "0.0.19",
|
|
33
|
+
"@rsbuild/test-helper": "0.0.19"
|
|
33
34
|
},
|
|
34
35
|
"peerDependencies": {
|
|
35
|
-
"@rsbuild/core": "^0.0.
|
|
36
|
+
"@rsbuild/core": "^0.0.19"
|
|
36
37
|
},
|
|
37
38
|
"publishConfig": {
|
|
38
39
|
"access": "public",
|