@rsbuild/plugin-vue 1.0.2 → 1.0.3
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 +8 -13
- package/dist/index.js +8 -13
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -39,13 +39,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
39
39
|
const external_node_module_namespaceObject = require("node:module");
|
|
40
40
|
const external_vue_loader_namespaceObject = require("vue-loader");
|
|
41
41
|
const isPlainObject = (obj)=>null !== obj && 'object' == typeof obj && '[object Object]' === Object.prototype.toString.call(obj);
|
|
42
|
-
const applySplitChunksRule =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
api.modifyBundlerChain((chain, param)=>{
|
|
48
|
-
let { environment } = param;
|
|
42
|
+
const applySplitChunksRule = (api, options = {
|
|
43
|
+
vue: true,
|
|
44
|
+
router: true
|
|
45
|
+
})=>{
|
|
46
|
+
api.modifyBundlerChain((chain, { environment })=>{
|
|
49
47
|
const { config } = environment;
|
|
50
48
|
if ('split-by-experience' !== config.performance.chunkSplit.strategy) return;
|
|
51
49
|
const currentConfig = chain.optimization.splitChunks.values();
|
|
@@ -75,15 +73,13 @@ const src_require = (0, external_node_module_namespaceObject.createRequire)(/*#_
|
|
|
75
73
|
return 'undefined' == typeof document ? new (module.require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
76
74
|
}());
|
|
77
75
|
const PLUGIN_VUE_NAME = 'rsbuild:vue';
|
|
78
|
-
function pluginVue() {
|
|
79
|
-
let options = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
|
|
76
|
+
function pluginVue(options = {}) {
|
|
80
77
|
return {
|
|
81
78
|
name: PLUGIN_VUE_NAME,
|
|
82
79
|
setup (api) {
|
|
83
80
|
const VUE_REGEXP = /\.vue$/;
|
|
84
81
|
const CSS_MODULES_REGEX = /\.modules?\.\w+$/i;
|
|
85
|
-
api.modifyEnvironmentConfig((config,
|
|
86
|
-
let { mergeEnvironmentConfig } = param;
|
|
82
|
+
api.modifyEnvironmentConfig((config, { mergeEnvironmentConfig })=>{
|
|
87
83
|
const extraConfig = {
|
|
88
84
|
source: {
|
|
89
85
|
define: {
|
|
@@ -102,8 +98,7 @@ function pluginVue() {
|
|
|
102
98
|
};
|
|
103
99
|
return merged;
|
|
104
100
|
});
|
|
105
|
-
api.modifyBundlerChain(async (chain,
|
|
106
|
-
let { CHAIN_ID } = param;
|
|
101
|
+
api.modifyBundlerChain(async (chain, { CHAIN_ID })=>{
|
|
107
102
|
chain.resolve.extensions.add('.vue');
|
|
108
103
|
const userLoaderOptions = options.vueLoaderOptions ?? {};
|
|
109
104
|
const compilerOptions = {
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as __WEBPACK_EXTERNAL_MODULE_node_module__ from "node:module";
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE_vue_loader__ from "vue-loader";
|
|
3
3
|
const isPlainObject = (obj)=>null !== obj && 'object' == typeof obj && '[object Object]' === Object.prototype.toString.call(obj);
|
|
4
|
-
const applySplitChunksRule =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
api.modifyBundlerChain((chain, param)=>{
|
|
10
|
-
let { environment } = param;
|
|
4
|
+
const applySplitChunksRule = (api, options = {
|
|
5
|
+
vue: true,
|
|
6
|
+
router: true
|
|
7
|
+
})=>{
|
|
8
|
+
api.modifyBundlerChain((chain, { environment })=>{
|
|
11
9
|
const { config } = environment;
|
|
12
10
|
if ('split-by-experience' !== config.performance.chunkSplit.strategy) return;
|
|
13
11
|
const currentConfig = chain.optimization.splitChunks.values();
|
|
@@ -35,15 +33,13 @@ const applySplitChunksRule = function(api) {
|
|
|
35
33
|
};
|
|
36
34
|
const src_require = (0, __WEBPACK_EXTERNAL_MODULE_node_module__.createRequire)(import.meta.url);
|
|
37
35
|
const PLUGIN_VUE_NAME = 'rsbuild:vue';
|
|
38
|
-
function pluginVue() {
|
|
39
|
-
let options = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
|
|
36
|
+
function pluginVue(options = {}) {
|
|
40
37
|
return {
|
|
41
38
|
name: PLUGIN_VUE_NAME,
|
|
42
39
|
setup (api) {
|
|
43
40
|
const VUE_REGEXP = /\.vue$/;
|
|
44
41
|
const CSS_MODULES_REGEX = /\.modules?\.\w+$/i;
|
|
45
|
-
api.modifyEnvironmentConfig((config,
|
|
46
|
-
let { mergeEnvironmentConfig } = param;
|
|
42
|
+
api.modifyEnvironmentConfig((config, { mergeEnvironmentConfig })=>{
|
|
47
43
|
const extraConfig = {
|
|
48
44
|
source: {
|
|
49
45
|
define: {
|
|
@@ -62,8 +58,7 @@ function pluginVue() {
|
|
|
62
58
|
};
|
|
63
59
|
return merged;
|
|
64
60
|
});
|
|
65
|
-
api.modifyBundlerChain(async (chain,
|
|
66
|
-
let { CHAIN_ID } = param;
|
|
61
|
+
api.modifyBundlerChain(async (chain, { CHAIN_ID })=>{
|
|
67
62
|
chain.resolve.extensions.add('.vue');
|
|
68
63
|
const userLoaderOptions = options.vueLoaderOptions ?? {};
|
|
69
64
|
const compilerOptions = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-vue",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Vue 3 plugin of Rsbuild",
|
|
5
5
|
"homepage": "https://rsbuild.dev",
|
|
6
6
|
"repository": {
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"typescript": "^5.6.3",
|
|
31
31
|
"vue": "^3.5.12",
|
|
32
32
|
"webpack": "^5.95.0",
|
|
33
|
-
"@rsbuild/core": "1.0.
|
|
33
|
+
"@rsbuild/core": "1.0.19",
|
|
34
34
|
"@scripts/test-helper": "1.0.1"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@rsbuild/core": "1.x
|
|
37
|
+
"@rsbuild/core": "1.x"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public",
|