@rsbuild/plugin-vue 0.7.9 → 1.0.0-alpha.0
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 +4 -3
- package/dist/index.d.ts +6 -9
- package/dist/index.js +5 -4
- package/dist/splitChunks.d.ts +3 -0
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -38,17 +38,18 @@ var import_vue_loader = require("vue-loader");
|
|
|
38
38
|
|
|
39
39
|
// src/splitChunks.ts
|
|
40
40
|
var import_shared = require("@rsbuild/shared");
|
|
41
|
+
var isPlainObject = (obj) => obj !== null && typeof obj === "object" && Object.prototype.toString.call(obj) === "[object Object]";
|
|
41
42
|
var applySplitChunksRule = (api, options = {
|
|
42
43
|
vue: true,
|
|
43
44
|
router: true
|
|
44
45
|
}) => {
|
|
45
|
-
api.modifyBundlerChain((chain) => {
|
|
46
|
-
const config =
|
|
46
|
+
api.modifyBundlerChain((chain, { environment }) => {
|
|
47
|
+
const { config } = environment;
|
|
47
48
|
if (config.performance.chunkSplit.strategy !== "split-by-experience") {
|
|
48
49
|
return;
|
|
49
50
|
}
|
|
50
51
|
const currentConfig = chain.optimization.splitChunks.values();
|
|
51
|
-
if (!
|
|
52
|
+
if (!isPlainObject(currentConfig)) {
|
|
52
53
|
return;
|
|
53
54
|
}
|
|
54
55
|
const extraGroups = {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { RsbuildPlugin } from '@rsbuild/core';
|
|
2
|
-
import { VueLoaderOptions } from 'vue-loader';
|
|
3
|
-
|
|
4
|
-
type SplitVueChunkOptions = {
|
|
1
|
+
import type { RsbuildPlugin } from '@rsbuild/core';
|
|
2
|
+
import { type VueLoaderOptions } from 'vue-loader';
|
|
3
|
+
export type SplitVueChunkOptions = {
|
|
5
4
|
/**
|
|
6
5
|
* Whether to enable split chunking for Vue-related dependencies (e.g., vue, vue-loader).
|
|
7
6
|
* @default true
|
|
@@ -13,7 +12,7 @@ type SplitVueChunkOptions = {
|
|
|
13
12
|
*/
|
|
14
13
|
router?: boolean;
|
|
15
14
|
};
|
|
16
|
-
type PluginVueOptions = {
|
|
15
|
+
export type PluginVueOptions = {
|
|
17
16
|
/**
|
|
18
17
|
* Options passed to `vue-loader`.
|
|
19
18
|
* @see https://vue-loader.vuejs.org/
|
|
@@ -24,7 +23,5 @@ type PluginVueOptions = {
|
|
|
24
23
|
*/
|
|
25
24
|
splitChunks?: SplitVueChunkOptions;
|
|
26
25
|
};
|
|
27
|
-
declare const PLUGIN_VUE_NAME = "rsbuild:vue";
|
|
28
|
-
declare function pluginVue(options?: PluginVueOptions): RsbuildPlugin;
|
|
29
|
-
|
|
30
|
-
export { PLUGIN_VUE_NAME, type PluginVueOptions, type SplitVueChunkOptions, pluginVue };
|
|
26
|
+
export declare const PLUGIN_VUE_NAME = "rsbuild:vue";
|
|
27
|
+
export declare function pluginVue(options?: PluginVueOptions): RsbuildPlugin;
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
9
9
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
// ../../node_modules/.pnpm/@modern-js+module-tools@2.
|
|
12
|
+
// ../../node_modules/.pnpm/@modern-js+module-tools@2.54.5_eslint@9.6.0_typescript@5.5.2/node_modules/@modern-js/module-tools/shims/esm.js
|
|
13
13
|
import { fileURLToPath } from "url";
|
|
14
14
|
import path from "path";
|
|
15
15
|
|
|
@@ -17,13 +17,14 @@ import path from "path";
|
|
|
17
17
|
import { VueLoaderPlugin } from "vue-loader";
|
|
18
18
|
|
|
19
19
|
// src/splitChunks.ts
|
|
20
|
-
import { createCacheGroups
|
|
20
|
+
import { createCacheGroups } from "@rsbuild/shared";
|
|
21
|
+
var isPlainObject = (obj) => obj !== null && typeof obj === "object" && Object.prototype.toString.call(obj) === "[object Object]";
|
|
21
22
|
var applySplitChunksRule = (api, options = {
|
|
22
23
|
vue: true,
|
|
23
24
|
router: true
|
|
24
25
|
}) => {
|
|
25
|
-
api.modifyBundlerChain((chain) => {
|
|
26
|
-
const config =
|
|
26
|
+
api.modifyBundlerChain((chain, { environment }) => {
|
|
27
|
+
const { config } = environment;
|
|
27
28
|
if (config.performance.chunkSplit.strategy !== "split-by-experience") {
|
|
28
29
|
return;
|
|
29
30
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-alpha.0",
|
|
4
4
|
"description": "Vue 3 plugin of Rsbuild",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"repository": {
|
|
@@ -24,18 +24,18 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"vue-loader": "^17.4.0",
|
|
27
|
-
"webpack": "^5.92.
|
|
28
|
-
"@rsbuild/shared": "0.
|
|
27
|
+
"webpack": "^5.92.1",
|
|
28
|
+
"@rsbuild/shared": "1.0.0-alpha.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"typescript": "^5.
|
|
31
|
+
"typescript": "^5.5.2",
|
|
32
32
|
"vue": "^3.4.19",
|
|
33
|
-
"webpack": "^5.92.
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
33
|
+
"webpack": "^5.92.1",
|
|
34
|
+
"@rsbuild/core": "1.0.0-alpha.0",
|
|
35
|
+
"@scripts/test-helper": "1.0.0-alpha.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@rsbuild/core": "^0.
|
|
38
|
+
"@rsbuild/core": "^1.0.0-alpha.0"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public",
|