@halo-dev/ui-plugin-bundler-kit 2.21.1 → 2.22.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/README.md +15 -15
- package/dist/index.d.mts +50 -48
- package/dist/index.mjs +192 -193
- package/package.json +12 -17
- package/src/constants/build.ts +4 -0
- package/src/constants/externals.ts +17 -0
- package/src/constants/halo-plugin.ts +3 -0
- package/src/index.ts +3 -0
- package/src/legacy.ts +69 -0
- package/src/rsbuild.ts +146 -0
- package/src/utils/halo-plugin.ts +11 -0
- package/src/vite.ts +85 -0
- package/tsconfig.json +18 -0
- package/tsdown.config.ts +10 -0
- package/dist/index.d.ts +0 -75
package/README.md
CHANGED
|
@@ -273,20 +273,20 @@ Both Vite and Rsbuild are excellent build tools, but they have different strengt
|
|
|
273
273
|
**Example with dynamic imports:**
|
|
274
274
|
|
|
275
275
|
```typescript
|
|
276
|
-
import { definePlugin } from
|
|
277
|
-
import { defineAsyncComponent } from
|
|
278
|
-
import { VLoading } from
|
|
276
|
+
import { definePlugin } from "@halo-dev/ui-shared";
|
|
277
|
+
import { defineAsyncComponent } from "vue";
|
|
278
|
+
import { VLoading } from "@halo-dev/components";
|
|
279
279
|
|
|
280
280
|
export default definePlugin({
|
|
281
281
|
routes: [
|
|
282
282
|
{
|
|
283
|
-
parentName:
|
|
283
|
+
parentName: "Root",
|
|
284
284
|
route: {
|
|
285
|
-
path:
|
|
286
|
-
name:
|
|
285
|
+
path: "demo",
|
|
286
|
+
name: "DemoPage",
|
|
287
287
|
// Lazy load heavy components
|
|
288
288
|
component: defineAsyncComponent({
|
|
289
|
-
loader: () => import(
|
|
289
|
+
loader: () => import("./views/DemoPage.vue"),
|
|
290
290
|
loadingComponent: VLoading,
|
|
291
291
|
}),
|
|
292
292
|
},
|
|
@@ -306,14 +306,14 @@ export default definePlugin({
|
|
|
306
306
|
|
|
307
307
|
### Summary
|
|
308
308
|
|
|
309
|
-
| Feature
|
|
310
|
-
|
|
311
|
-
| Code Splitting
|
|
312
|
-
| Vue Ecosystem
|
|
313
|
-
| Build Performance | ✅ Good
|
|
314
|
-
| Dev Experience
|
|
315
|
-
| Plugin Ecosystem
|
|
316
|
-
| Configuration
|
|
309
|
+
| Feature | Vite | Rsbuild |
|
|
310
|
+
| ----------------- | ------------ | ------------ |
|
|
311
|
+
| Code Splitting | ❌ Limited | ✅ Excellent |
|
|
312
|
+
| Vue Ecosystem | ✅ Excellent | ✅ Good |
|
|
313
|
+
| Build Performance | ✅ Good | ✅ Excellent |
|
|
314
|
+
| Dev Experience | ✅ Excellent | ✅ Excellent |
|
|
315
|
+
| Plugin Ecosystem | ✅ Rich | ✅ Growing |
|
|
316
|
+
| Configuration | ✅ Simple | ⚖️ Moderate |
|
|
317
317
|
|
|
318
318
|
**Recommendation**: Use **Rsbuild** for complex plugins with large frontend codebases, and **Vite** for simpler plugins or when you need extensive Vue ecosystem integration.
|
|
319
319
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,75 +1,77 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { RsbuildConfig, ConfigParams } from '@rsbuild/core';
|
|
1
|
+
import { ConfigParams, RsbuildConfig } from "@rsbuild/core";
|
|
2
|
+
import { Plugin, UserConfig, UserConfigFnObject } from "vite";
|
|
4
3
|
|
|
4
|
+
//#region src/legacy.d.ts
|
|
5
5
|
interface HaloUIPluginBundlerKitOptions {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
outDir?: string | {
|
|
7
|
+
dev: string;
|
|
8
|
+
prod: string;
|
|
9
|
+
};
|
|
10
|
+
manifestPath?: string;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* @deprecated Use `viteConfig` or `rsbuildConfig` instead.
|
|
14
14
|
*/
|
|
15
15
|
declare function HaloUIPluginBundlerKit(options?: HaloUIPluginBundlerKitOptions): Plugin;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/rsbuild.d.ts
|
|
18
|
+
interface RsBuildUserConfig {
|
|
19
|
+
/**
|
|
20
|
+
* Halo plugin manifest path.
|
|
21
|
+
*
|
|
22
|
+
* @default "../src/main/resources/plugin.yaml"
|
|
23
|
+
*/
|
|
24
|
+
manifestPath?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Custom Rsbuild config.
|
|
27
|
+
*/
|
|
28
|
+
rsbuild: RsbuildConfig | ((env: ConfigParams) => RsbuildConfig);
|
|
28
29
|
}
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
+
* Rsbuild config for Halo UI Plugin.
|
|
31
32
|
*
|
|
32
33
|
* @example
|
|
33
34
|
* ```ts
|
|
34
|
-
* import {
|
|
35
|
+
* import { rsbuildConfig } from "@halo-dev/ui-plugin-bundler-kit";
|
|
35
36
|
*
|
|
36
|
-
* export default
|
|
37
|
-
*
|
|
38
|
-
* // your custom
|
|
37
|
+
* export default rsbuildConfig({
|
|
38
|
+
* rsbuild: {
|
|
39
|
+
* // your custom rsbuild config
|
|
39
40
|
* },
|
|
40
41
|
* });
|
|
41
42
|
* ```
|
|
43
|
+
* @param config
|
|
44
|
+
* @returns
|
|
42
45
|
*/
|
|
43
|
-
declare function
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
46
|
+
declare function rsbuildConfig(config?: RsBuildUserConfig): (env: ConfigParams) => RsbuildConfig;
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/vite.d.ts
|
|
49
|
+
interface ViteUserConfig {
|
|
50
|
+
/**
|
|
51
|
+
* Halo plugin manifest path.
|
|
52
|
+
*
|
|
53
|
+
* @default "../src/main/resources/plugin.yaml"
|
|
54
|
+
*/
|
|
55
|
+
manifestPath?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Custom Vite config.
|
|
58
|
+
*/
|
|
59
|
+
vite: UserConfig | UserConfigFnObject;
|
|
56
60
|
}
|
|
57
61
|
/**
|
|
58
|
-
*
|
|
62
|
+
* Vite config for Halo UI Plugin.
|
|
59
63
|
*
|
|
60
64
|
* @example
|
|
61
65
|
* ```ts
|
|
62
|
-
* import {
|
|
66
|
+
* import { viteConfig } from "@halo-dev/ui-plugin-bundler-kit";
|
|
63
67
|
*
|
|
64
|
-
* export default
|
|
65
|
-
*
|
|
66
|
-
* // your custom
|
|
68
|
+
* export default viteConfig({
|
|
69
|
+
* vite: {
|
|
70
|
+
* // your custom vite config
|
|
67
71
|
* },
|
|
68
72
|
* });
|
|
69
73
|
* ```
|
|
70
|
-
* @param config
|
|
71
|
-
* @returns
|
|
72
74
|
*/
|
|
73
|
-
declare function
|
|
74
|
-
|
|
75
|
-
export { HaloUIPluginBundlerKit, rsbuildConfig, viteConfig };
|
|
75
|
+
declare function viteConfig(config?: ViteUserConfig): UserConfigFnObject;
|
|
76
|
+
//#endregion
|
|
77
|
+
export { HaloUIPluginBundlerKit, rsbuildConfig, viteConfig };
|
package/dist/index.mjs
CHANGED
|
@@ -1,213 +1,212 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { defineConfig,
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
1
|
+
import yaml from "js-yaml";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import { defineConfig, mergeRsbuildConfig } from "@rsbuild/core";
|
|
4
|
+
import { pluginVue } from "@rsbuild/plugin-vue";
|
|
5
|
+
import Vue from "@vitejs/plugin-vue";
|
|
6
|
+
import { defineConfig as defineConfig$1, mergeConfig } from "vite";
|
|
7
7
|
|
|
8
|
+
//#region src/constants/build.ts
|
|
9
|
+
const DEFAULT_OUT_DIR_DEV = "../build/resources/main/console";
|
|
10
|
+
const DEFAULT_OUT_DIR_PROD = "./build/dist";
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/constants/externals.ts
|
|
8
14
|
const GLOBALS = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
vue: "Vue",
|
|
16
|
+
"vue-router": "VueRouter",
|
|
17
|
+
pinia: "Pinia",
|
|
18
|
+
"@vueuse/core": "VueUse",
|
|
19
|
+
"@vueuse/components": "VueUse",
|
|
20
|
+
"@vueuse/router": "VueUse",
|
|
21
|
+
"@halo-dev/ui-shared": "HaloUiShared",
|
|
22
|
+
"@halo-dev/components": "HaloComponents",
|
|
23
|
+
"@halo-dev/api-client": "HaloApiClient",
|
|
24
|
+
"@halo-dev/richtext-editor": "RichTextEditor",
|
|
25
|
+
axios: "axios"
|
|
19
26
|
};
|
|
20
27
|
const EXTERNALS = Object.keys(GLOBALS);
|
|
21
28
|
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/constants/halo-plugin.ts
|
|
22
31
|
const DEFAULT_MANIFEST_PATH = "../src/main/resources/plugin.yaml";
|
|
23
32
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/utils/halo-plugin.ts
|
|
27
35
|
function getHaloPluginManifest(manifestPath) {
|
|
28
|
-
|
|
29
|
-
fs.readFileSync(manifestPath, "utf8")
|
|
30
|
-
);
|
|
31
|
-
return manifest;
|
|
36
|
+
return yaml.load(fs.readFileSync(manifestPath, "utf8"));
|
|
32
37
|
}
|
|
33
38
|
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/legacy.ts
|
|
34
41
|
const LEGACY_OUT_DIR_PROD = "../src/main/resources/console";
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated Use `viteConfig` or `rsbuildConfig` instead.
|
|
44
|
+
*/
|
|
35
45
|
function HaloUIPluginBundlerKit(options = {}) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
globals: GLOBALS,
|
|
68
|
-
extend: true
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
};
|
|
46
|
+
return {
|
|
47
|
+
name: "halo-ui-plugin-bundler-kit",
|
|
48
|
+
config(config, env) {
|
|
49
|
+
const isProduction = env.mode === "production";
|
|
50
|
+
let outDir = isProduction ? LEGACY_OUT_DIR_PROD : DEFAULT_OUT_DIR_DEV;
|
|
51
|
+
if (options.outDir) if (typeof options.outDir === "string") outDir = options.outDir;
|
|
52
|
+
else outDir = isProduction ? options.outDir.prod : options.outDir.dev;
|
|
53
|
+
const manifest = getHaloPluginManifest(options.manifestPath || DEFAULT_MANIFEST_PATH);
|
|
54
|
+
return {
|
|
55
|
+
...config,
|
|
56
|
+
define: { "process.env": process.env },
|
|
57
|
+
build: {
|
|
58
|
+
outDir,
|
|
59
|
+
emptyOutDir: true,
|
|
60
|
+
lib: {
|
|
61
|
+
entry: "src/index.ts",
|
|
62
|
+
name: manifest.metadata.name,
|
|
63
|
+
formats: ["iife"],
|
|
64
|
+
fileName: () => "main.js"
|
|
65
|
+
},
|
|
66
|
+
rollupOptions: {
|
|
67
|
+
external: EXTERNALS,
|
|
68
|
+
output: {
|
|
69
|
+
globals: GLOBALS,
|
|
70
|
+
extend: true
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
};
|
|
75
77
|
}
|
|
76
78
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/rsbuild.ts
|
|
81
|
+
function createRsbuildPresetsConfig(manifestPath) {
|
|
82
|
+
const manifest = getHaloPluginManifest(manifestPath);
|
|
83
|
+
return defineConfig(({ envMode }) => {
|
|
84
|
+
const outDir = envMode === "production" ? DEFAULT_OUT_DIR_PROD : DEFAULT_OUT_DIR_DEV;
|
|
85
|
+
return {
|
|
86
|
+
mode: envMode || "production",
|
|
87
|
+
plugins: [pluginVue()],
|
|
88
|
+
source: { entry: { main: "./src/index.ts" } },
|
|
89
|
+
dev: { hmr: false },
|
|
90
|
+
performance: { chunkSplit: { strategy: "custom" } },
|
|
91
|
+
tools: {
|
|
92
|
+
rspack: {
|
|
93
|
+
optimization: {
|
|
94
|
+
splitChunks: { chunks: "async" },
|
|
95
|
+
moduleIds: "named"
|
|
96
|
+
},
|
|
97
|
+
experiments: { rspackFuture: { bundlerInfo: { force: false } } },
|
|
98
|
+
module: { parser: { javascript: { importMeta: false } } },
|
|
99
|
+
output: {
|
|
100
|
+
publicPath: `/plugins/${manifest.metadata.name}/assets/console/`,
|
|
101
|
+
library: {
|
|
102
|
+
type: "window",
|
|
103
|
+
export: "default",
|
|
104
|
+
name: manifest.metadata.name
|
|
105
|
+
},
|
|
106
|
+
globalObject: "window",
|
|
107
|
+
iife: true
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
htmlPlugin: false
|
|
111
|
+
},
|
|
112
|
+
output: {
|
|
113
|
+
distPath: {
|
|
114
|
+
root: outDir,
|
|
115
|
+
js: "",
|
|
116
|
+
css: "",
|
|
117
|
+
jsAsync: "chunks",
|
|
118
|
+
cssAsync: "chunks"
|
|
119
|
+
},
|
|
120
|
+
cleanDistPath: true,
|
|
121
|
+
filename: {
|
|
122
|
+
css: (pathData) => {
|
|
123
|
+
if (pathData.chunk?.name === "main") return "style.css";
|
|
124
|
+
return "[name].[contenthash:8].css";
|
|
125
|
+
},
|
|
126
|
+
js: (pathData) => {
|
|
127
|
+
if (pathData.chunk?.name === "main") return "main.js";
|
|
128
|
+
return "[name].[contenthash:8].js";
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
externals: GLOBALS
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
});
|
|
106
135
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
136
|
+
/**
|
|
137
|
+
* Rsbuild config for Halo UI Plugin.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```ts
|
|
141
|
+
* import { rsbuildConfig } from "@halo-dev/ui-plugin-bundler-kit";
|
|
142
|
+
*
|
|
143
|
+
* export default rsbuildConfig({
|
|
144
|
+
* rsbuild: {
|
|
145
|
+
* // your custom rsbuild config
|
|
146
|
+
* },
|
|
147
|
+
* });
|
|
148
|
+
* ```
|
|
149
|
+
* @param config
|
|
150
|
+
* @returns
|
|
151
|
+
*/
|
|
152
|
+
function rsbuildConfig(config) {
|
|
153
|
+
const presetsConfigFn = createRsbuildPresetsConfig(config?.manifestPath || DEFAULT_MANIFEST_PATH);
|
|
154
|
+
return defineConfig((env) => {
|
|
155
|
+
return mergeRsbuildConfig(presetsConfigFn(env), typeof config?.rsbuild === "function" ? config.rsbuild(env) : config?.rsbuild || {});
|
|
156
|
+
});
|
|
116
157
|
}
|
|
117
158
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
rspackFuture: {
|
|
149
|
-
bundlerInfo: {
|
|
150
|
-
force: false
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
module: {
|
|
155
|
-
parser: {
|
|
156
|
-
javascript: {
|
|
157
|
-
importMeta: false
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
output: {
|
|
162
|
-
publicPath: `/plugins/${manifest.metadata.name}/assets/console/`,
|
|
163
|
-
library: {
|
|
164
|
-
type: "window",
|
|
165
|
-
export: "default",
|
|
166
|
-
name: manifest.metadata.name
|
|
167
|
-
},
|
|
168
|
-
globalObject: "window",
|
|
169
|
-
iife: true
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
htmlPlugin: false
|
|
173
|
-
},
|
|
174
|
-
output: {
|
|
175
|
-
distPath: {
|
|
176
|
-
root: outDir,
|
|
177
|
-
js: "",
|
|
178
|
-
css: "",
|
|
179
|
-
jsAsync: "chunks",
|
|
180
|
-
cssAsync: "chunks"
|
|
181
|
-
},
|
|
182
|
-
cleanDistPath: true,
|
|
183
|
-
filename: {
|
|
184
|
-
css: (pathData) => {
|
|
185
|
-
if (pathData.chunk?.name === "main") {
|
|
186
|
-
return "style.css";
|
|
187
|
-
}
|
|
188
|
-
return "[name].[contenthash:8].css";
|
|
189
|
-
},
|
|
190
|
-
js: (pathData) => {
|
|
191
|
-
if (pathData.chunk?.name === "main") {
|
|
192
|
-
return "main.js";
|
|
193
|
-
}
|
|
194
|
-
return "[name].[contenthash:8].js";
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
externals: GLOBALS
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
});
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/vite.ts
|
|
161
|
+
function createVitePresetsConfig(manifestPath) {
|
|
162
|
+
const manifest = getHaloPluginManifest(manifestPath);
|
|
163
|
+
return defineConfig$1(({ mode }) => {
|
|
164
|
+
const isProduction = mode === "production";
|
|
165
|
+
return {
|
|
166
|
+
mode: mode || "production",
|
|
167
|
+
plugins: [Vue()],
|
|
168
|
+
define: { "process.env.NODE_ENV": "'production'" },
|
|
169
|
+
build: {
|
|
170
|
+
outDir: isProduction ? DEFAULT_OUT_DIR_PROD : DEFAULT_OUT_DIR_DEV,
|
|
171
|
+
emptyOutDir: true,
|
|
172
|
+
lib: {
|
|
173
|
+
entry: "src/index.ts",
|
|
174
|
+
name: manifest.metadata.name,
|
|
175
|
+
formats: ["iife"],
|
|
176
|
+
fileName: () => "main.js",
|
|
177
|
+
cssFileName: "style"
|
|
178
|
+
},
|
|
179
|
+
rollupOptions: {
|
|
180
|
+
external: EXTERNALS,
|
|
181
|
+
output: {
|
|
182
|
+
globals: GLOBALS,
|
|
183
|
+
extend: true
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
});
|
|
201
189
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
190
|
+
/**
|
|
191
|
+
* Vite config for Halo UI Plugin.
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```ts
|
|
195
|
+
* import { viteConfig } from "@halo-dev/ui-plugin-bundler-kit";
|
|
196
|
+
*
|
|
197
|
+
* export default viteConfig({
|
|
198
|
+
* vite: {
|
|
199
|
+
* // your custom vite config
|
|
200
|
+
* },
|
|
201
|
+
* });
|
|
202
|
+
* ```
|
|
203
|
+
*/
|
|
204
|
+
function viteConfig(config) {
|
|
205
|
+
const presetsConfigFn = createVitePresetsConfig(config?.manifestPath || DEFAULT_MANIFEST_PATH);
|
|
206
|
+
return defineConfig$1((env) => {
|
|
207
|
+
return mergeConfig(presetsConfigFn(env), typeof config?.vite === "function" ? config.vite(env) : config?.vite || {});
|
|
208
|
+
});
|
|
211
209
|
}
|
|
212
210
|
|
|
213
|
-
|
|
211
|
+
//#endregion
|
|
212
|
+
export { HaloUIPluginBundlerKit, rsbuildConfig, viteConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@halo-dev/ui-plugin-bundler-kit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.22.0",
|
|
4
4
|
"homepage": "https://github.com/halo-dev/halo/tree/main/ui/packages/ui-plugin-bundler-kit#readme",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/halo-dev/halo/issues"
|
|
@@ -14,35 +14,30 @@
|
|
|
14
14
|
"author": "@halo-dev",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
|
-
".":
|
|
18
|
-
|
|
19
|
-
"import": "./dist/index.mjs"
|
|
20
|
-
}
|
|
17
|
+
".": "./dist/index.mjs",
|
|
18
|
+
"./package.json": "./package.json"
|
|
21
19
|
},
|
|
22
20
|
"main": "./dist/index.mjs",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"dist"
|
|
26
|
-
],
|
|
21
|
+
"module": "./dist/index.mjs",
|
|
22
|
+
"types": "./dist/index.d.mts",
|
|
27
23
|
"dependencies": {
|
|
28
|
-
"js-yaml": "^4.1.
|
|
29
|
-
"@halo-dev/api-client": "2.
|
|
24
|
+
"js-yaml": "^4.1.1",
|
|
25
|
+
"@halo-dev/api-client": "2.22.0"
|
|
30
26
|
},
|
|
31
27
|
"devDependencies": {
|
|
32
|
-
"@types/js-yaml": "^4.0.9"
|
|
33
|
-
"unbuild": "^3.5.0"
|
|
28
|
+
"@types/js-yaml": "^4.0.9"
|
|
34
29
|
},
|
|
35
30
|
"peerDependencies": {
|
|
36
31
|
"@rsbuild/core": "^1.0.0",
|
|
37
32
|
"@rsbuild/plugin-vue": "^1.0.0",
|
|
38
|
-
"@vitejs/plugin-vue": "^
|
|
39
|
-
"vite": "^
|
|
33
|
+
"@vitejs/plugin-vue": "^5.0.0 || ^6.0.0",
|
|
34
|
+
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
|
|
40
35
|
},
|
|
41
36
|
"engines": {
|
|
42
37
|
"node": "^18.0.0 || >=20.0.0"
|
|
43
38
|
},
|
|
44
39
|
"scripts": {
|
|
45
|
-
"build": "
|
|
46
|
-
"dev": "
|
|
40
|
+
"build": "tsdown",
|
|
41
|
+
"dev": "tsdown --watch"
|
|
47
42
|
}
|
|
48
43
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const GLOBALS = {
|
|
2
|
+
vue: "Vue",
|
|
3
|
+
"vue-router": "VueRouter",
|
|
4
|
+
pinia: "Pinia",
|
|
5
|
+
"@vueuse/core": "VueUse",
|
|
6
|
+
"@vueuse/components": "VueUse",
|
|
7
|
+
"@vueuse/router": "VueUse",
|
|
8
|
+
"@halo-dev/ui-shared": "HaloUiShared",
|
|
9
|
+
"@halo-dev/components": "HaloComponents",
|
|
10
|
+
"@halo-dev/api-client": "HaloApiClient",
|
|
11
|
+
"@halo-dev/richtext-editor": "RichTextEditor",
|
|
12
|
+
axios: "axios",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const EXTERNALS = Object.keys(GLOBALS) as string[];
|
|
16
|
+
|
|
17
|
+
export { EXTERNALS, GLOBALS };
|
package/src/index.ts
ADDED
package/src/legacy.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Plugin } from "vite";
|
|
2
|
+
import { DEFAULT_OUT_DIR_DEV } from "./constants/build";
|
|
3
|
+
import { EXTERNALS, GLOBALS } from "./constants/externals";
|
|
4
|
+
import { DEFAULT_MANIFEST_PATH } from "./constants/halo-plugin";
|
|
5
|
+
import { getHaloPluginManifest } from "./utils/halo-plugin";
|
|
6
|
+
|
|
7
|
+
const LEGACY_OUT_DIR_PROD = "../src/main/resources/console";
|
|
8
|
+
|
|
9
|
+
interface HaloUIPluginBundlerKitOptions {
|
|
10
|
+
outDir?:
|
|
11
|
+
| string
|
|
12
|
+
| {
|
|
13
|
+
dev: string;
|
|
14
|
+
prod: string;
|
|
15
|
+
};
|
|
16
|
+
manifestPath?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Use `viteConfig` or `rsbuildConfig` instead.
|
|
21
|
+
*/
|
|
22
|
+
export function HaloUIPluginBundlerKit(
|
|
23
|
+
options: HaloUIPluginBundlerKitOptions = {}
|
|
24
|
+
): Plugin {
|
|
25
|
+
return {
|
|
26
|
+
name: "halo-ui-plugin-bundler-kit",
|
|
27
|
+
config(config, env) {
|
|
28
|
+
const isProduction = env.mode === "production";
|
|
29
|
+
|
|
30
|
+
let outDir = isProduction ? LEGACY_OUT_DIR_PROD : DEFAULT_OUT_DIR_DEV;
|
|
31
|
+
|
|
32
|
+
if (options.outDir) {
|
|
33
|
+
if (typeof options.outDir === "string") {
|
|
34
|
+
outDir = options.outDir;
|
|
35
|
+
} else {
|
|
36
|
+
outDir = isProduction ? options.outDir.prod : options.outDir.dev;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const manifestPath = options.manifestPath || DEFAULT_MANIFEST_PATH;
|
|
41
|
+
|
|
42
|
+
const manifest = getHaloPluginManifest(manifestPath);
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
...config,
|
|
46
|
+
define: {
|
|
47
|
+
"process.env": process.env,
|
|
48
|
+
},
|
|
49
|
+
build: {
|
|
50
|
+
outDir,
|
|
51
|
+
emptyOutDir: true,
|
|
52
|
+
lib: {
|
|
53
|
+
entry: "src/index.ts",
|
|
54
|
+
name: manifest.metadata.name,
|
|
55
|
+
formats: ["iife"],
|
|
56
|
+
fileName: () => "main.js",
|
|
57
|
+
},
|
|
58
|
+
rollupOptions: {
|
|
59
|
+
external: EXTERNALS,
|
|
60
|
+
output: {
|
|
61
|
+
globals: GLOBALS,
|
|
62
|
+
extend: true,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|
package/src/rsbuild.ts
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineConfig,
|
|
3
|
+
mergeRsbuildConfig,
|
|
4
|
+
type ConfigParams,
|
|
5
|
+
type RsbuildConfig,
|
|
6
|
+
type RsbuildMode,
|
|
7
|
+
} from "@rsbuild/core";
|
|
8
|
+
import { pluginVue } from "@rsbuild/plugin-vue";
|
|
9
|
+
import { DEFAULT_OUT_DIR_DEV, DEFAULT_OUT_DIR_PROD } from "./constants/build";
|
|
10
|
+
import { GLOBALS } from "./constants/externals";
|
|
11
|
+
import { DEFAULT_MANIFEST_PATH } from "./constants/halo-plugin";
|
|
12
|
+
import { getHaloPluginManifest } from "./utils/halo-plugin";
|
|
13
|
+
|
|
14
|
+
export interface RsBuildUserConfig {
|
|
15
|
+
/**
|
|
16
|
+
* Halo plugin manifest path.
|
|
17
|
+
*
|
|
18
|
+
* @default "../src/main/resources/plugin.yaml"
|
|
19
|
+
*/
|
|
20
|
+
manifestPath?: string;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Custom Rsbuild config.
|
|
24
|
+
*/
|
|
25
|
+
rsbuild: RsbuildConfig | ((env: ConfigParams) => RsbuildConfig);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function createRsbuildPresetsConfig(manifestPath: string) {
|
|
29
|
+
const manifest = getHaloPluginManifest(manifestPath);
|
|
30
|
+
|
|
31
|
+
return defineConfig(({ envMode }) => {
|
|
32
|
+
const isProduction = envMode === "production";
|
|
33
|
+
|
|
34
|
+
const outDir = isProduction ? DEFAULT_OUT_DIR_PROD : DEFAULT_OUT_DIR_DEV;
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
mode: (envMode as RsbuildMode) || "production",
|
|
38
|
+
plugins: [pluginVue()],
|
|
39
|
+
source: {
|
|
40
|
+
entry: {
|
|
41
|
+
main: "./src/index.ts",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
dev: {
|
|
45
|
+
hmr: false,
|
|
46
|
+
},
|
|
47
|
+
performance: {
|
|
48
|
+
chunkSplit: {
|
|
49
|
+
strategy: "custom",
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
tools: {
|
|
53
|
+
rspack: {
|
|
54
|
+
optimization: {
|
|
55
|
+
splitChunks: {
|
|
56
|
+
chunks: "async",
|
|
57
|
+
},
|
|
58
|
+
moduleIds: "named",
|
|
59
|
+
},
|
|
60
|
+
experiments: {
|
|
61
|
+
rspackFuture: {
|
|
62
|
+
bundlerInfo: {
|
|
63
|
+
force: false,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
module: {
|
|
68
|
+
parser: {
|
|
69
|
+
javascript: {
|
|
70
|
+
importMeta: false,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
output: {
|
|
75
|
+
publicPath: `/plugins/${manifest.metadata.name}/assets/console/`,
|
|
76
|
+
library: {
|
|
77
|
+
type: "window",
|
|
78
|
+
export: "default",
|
|
79
|
+
name: manifest.metadata.name,
|
|
80
|
+
},
|
|
81
|
+
globalObject: "window",
|
|
82
|
+
iife: true,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
htmlPlugin: false,
|
|
86
|
+
},
|
|
87
|
+
output: {
|
|
88
|
+
distPath: {
|
|
89
|
+
root: outDir,
|
|
90
|
+
js: "",
|
|
91
|
+
css: "",
|
|
92
|
+
jsAsync: "chunks",
|
|
93
|
+
cssAsync: "chunks",
|
|
94
|
+
},
|
|
95
|
+
cleanDistPath: true,
|
|
96
|
+
filename: {
|
|
97
|
+
css: (pathData) => {
|
|
98
|
+
if (pathData.chunk?.name === "main") {
|
|
99
|
+
return "style.css";
|
|
100
|
+
}
|
|
101
|
+
return "[name].[contenthash:8].css";
|
|
102
|
+
},
|
|
103
|
+
js: (pathData) => {
|
|
104
|
+
if (pathData.chunk?.name === "main") {
|
|
105
|
+
return "main.js";
|
|
106
|
+
}
|
|
107
|
+
return "[name].[contenthash:8].js";
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
externals: GLOBALS,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Rsbuild config for Halo UI Plugin.
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* import { rsbuildConfig } from "@halo-dev/ui-plugin-bundler-kit";
|
|
122
|
+
*
|
|
123
|
+
* export default rsbuildConfig({
|
|
124
|
+
* rsbuild: {
|
|
125
|
+
* // your custom rsbuild config
|
|
126
|
+
* },
|
|
127
|
+
* });
|
|
128
|
+
* ```
|
|
129
|
+
* @param config
|
|
130
|
+
* @returns
|
|
131
|
+
*/
|
|
132
|
+
export function rsbuildConfig(
|
|
133
|
+
config?: RsBuildUserConfig
|
|
134
|
+
): (env: ConfigParams) => RsbuildConfig {
|
|
135
|
+
const presetsConfigFn = createRsbuildPresetsConfig(
|
|
136
|
+
config?.manifestPath || DEFAULT_MANIFEST_PATH
|
|
137
|
+
);
|
|
138
|
+
return defineConfig((env) => {
|
|
139
|
+
const presetsConfig = presetsConfigFn(env);
|
|
140
|
+
const userConfig =
|
|
141
|
+
typeof config?.rsbuild === "function"
|
|
142
|
+
? config.rsbuild(env)
|
|
143
|
+
: config?.rsbuild || {};
|
|
144
|
+
return mergeRsbuildConfig(presetsConfig, userConfig);
|
|
145
|
+
});
|
|
146
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Plugin as HaloPlugin } from "@halo-dev/api-client";
|
|
2
|
+
import yaml from "js-yaml";
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
|
|
5
|
+
export function getHaloPluginManifest(manifestPath: string) {
|
|
6
|
+
const manifest = yaml.load(
|
|
7
|
+
fs.readFileSync(manifestPath, "utf8")
|
|
8
|
+
) as HaloPlugin;
|
|
9
|
+
|
|
10
|
+
return manifest;
|
|
11
|
+
}
|
package/src/vite.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import Vue from "@vitejs/plugin-vue";
|
|
2
|
+
import {
|
|
3
|
+
defineConfig,
|
|
4
|
+
mergeConfig,
|
|
5
|
+
UserConfig,
|
|
6
|
+
UserConfigFnObject,
|
|
7
|
+
} from "vite";
|
|
8
|
+
import { DEFAULT_OUT_DIR_DEV, DEFAULT_OUT_DIR_PROD } from "./constants/build";
|
|
9
|
+
import { EXTERNALS, GLOBALS } from "./constants/externals";
|
|
10
|
+
import { DEFAULT_MANIFEST_PATH } from "./constants/halo-plugin";
|
|
11
|
+
import { getHaloPluginManifest } from "./utils/halo-plugin";
|
|
12
|
+
|
|
13
|
+
export interface ViteUserConfig {
|
|
14
|
+
/**
|
|
15
|
+
* Halo plugin manifest path.
|
|
16
|
+
*
|
|
17
|
+
* @default "../src/main/resources/plugin.yaml"
|
|
18
|
+
*/
|
|
19
|
+
manifestPath?: string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Custom Vite config.
|
|
23
|
+
*/
|
|
24
|
+
vite: UserConfig | UserConfigFnObject;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function createVitePresetsConfig(manifestPath: string) {
|
|
28
|
+
const manifest = getHaloPluginManifest(manifestPath);
|
|
29
|
+
|
|
30
|
+
return defineConfig(({ mode }) => {
|
|
31
|
+
const isProduction = mode === "production";
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
mode: mode || "production",
|
|
35
|
+
plugins: [Vue()],
|
|
36
|
+
define: { "process.env.NODE_ENV": "'production'" },
|
|
37
|
+
build: {
|
|
38
|
+
outDir: isProduction ? DEFAULT_OUT_DIR_PROD : DEFAULT_OUT_DIR_DEV,
|
|
39
|
+
emptyOutDir: true,
|
|
40
|
+
lib: {
|
|
41
|
+
entry: "src/index.ts",
|
|
42
|
+
name: manifest.metadata.name,
|
|
43
|
+
formats: ["iife"],
|
|
44
|
+
fileName: () => "main.js",
|
|
45
|
+
cssFileName: "style",
|
|
46
|
+
},
|
|
47
|
+
rollupOptions: {
|
|
48
|
+
external: EXTERNALS,
|
|
49
|
+
output: {
|
|
50
|
+
globals: GLOBALS,
|
|
51
|
+
extend: true,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Vite config for Halo UI Plugin.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* import { viteConfig } from "@halo-dev/ui-plugin-bundler-kit";
|
|
65
|
+
*
|
|
66
|
+
* export default viteConfig({
|
|
67
|
+
* vite: {
|
|
68
|
+
* // your custom vite config
|
|
69
|
+
* },
|
|
70
|
+
* });
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export function viteConfig(config?: ViteUserConfig) {
|
|
74
|
+
const presetsConfigFn = createVitePresetsConfig(
|
|
75
|
+
config?.manifestPath || DEFAULT_MANIFEST_PATH
|
|
76
|
+
);
|
|
77
|
+
return defineConfig((env) => {
|
|
78
|
+
const presetsConfig = presetsConfigFn(env);
|
|
79
|
+
const userConfig =
|
|
80
|
+
typeof config?.vite === "function"
|
|
81
|
+
? config.vite(env)
|
|
82
|
+
: config?.vite || {};
|
|
83
|
+
return mergeConfig(presetsConfig, userConfig);
|
|
84
|
+
});
|
|
85
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"include": ["src"],
|
|
3
|
+
"exclude": ["**/*.spec.ts"],
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "dist",
|
|
6
|
+
"target": "ES2020",
|
|
7
|
+
"module": "ES2020",
|
|
8
|
+
"moduleResolution": "node",
|
|
9
|
+
"strict": true,
|
|
10
|
+
"declaration": true,
|
|
11
|
+
"sourceMap": true,
|
|
12
|
+
"noImplicitOverride": true,
|
|
13
|
+
"noUnusedLocals": true,
|
|
14
|
+
"esModuleInterop": true,
|
|
15
|
+
"baseUrl": ".",
|
|
16
|
+
"resolveJsonModule": true
|
|
17
|
+
}
|
|
18
|
+
}
|
package/tsdown.config.ts
ADDED
package/dist/index.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { Plugin, UserConfig, UserConfigFnObject } from 'vite';
|
|
2
|
-
import * as _rsbuild_core_dist_types_loadConfig from '@rsbuild/core/dist-types/loadConfig';
|
|
3
|
-
import { RsbuildConfig, ConfigParams } from '@rsbuild/core';
|
|
4
|
-
|
|
5
|
-
interface HaloUIPluginBundlerKitOptions {
|
|
6
|
-
outDir?: string | {
|
|
7
|
-
dev: string;
|
|
8
|
-
prod: string;
|
|
9
|
-
};
|
|
10
|
-
manifestPath?: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated Use `viteConfig` or `rsbuildConfig` instead.
|
|
14
|
-
*/
|
|
15
|
-
declare function HaloUIPluginBundlerKit(options?: HaloUIPluginBundlerKitOptions): Plugin;
|
|
16
|
-
|
|
17
|
-
interface ViteUserConfig {
|
|
18
|
-
/**
|
|
19
|
-
* Halo plugin manifest path.
|
|
20
|
-
*
|
|
21
|
-
* @default "../src/main/resources/plugin.yaml"
|
|
22
|
-
*/
|
|
23
|
-
manifestPath?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Custom Vite config.
|
|
26
|
-
*/
|
|
27
|
-
vite: UserConfig | UserConfigFnObject;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Vite config for Halo UI Plugin.
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```ts
|
|
34
|
-
* import { viteConfig } from "@halo-dev/ui-plugin-bundler-kit";
|
|
35
|
-
*
|
|
36
|
-
* export default viteConfig({
|
|
37
|
-
* vite: {
|
|
38
|
-
* // your custom vite config
|
|
39
|
-
* },
|
|
40
|
-
* });
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
declare function viteConfig(config?: ViteUserConfig): UserConfigFnObject;
|
|
44
|
-
|
|
45
|
-
interface RsBuildUserConfig {
|
|
46
|
-
/**
|
|
47
|
-
* Halo plugin manifest path.
|
|
48
|
-
*
|
|
49
|
-
* @default "../src/main/resources/plugin.yaml"
|
|
50
|
-
*/
|
|
51
|
-
manifestPath?: string;
|
|
52
|
-
/**
|
|
53
|
-
* Custom Rsbuild config.
|
|
54
|
-
*/
|
|
55
|
-
rsbuild: RsbuildConfig | ((env: ConfigParams) => RsbuildConfig);
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Rsbuild config for Halo UI Plugin.
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```ts
|
|
62
|
-
* import { rsbuildConfig } from "@halo-dev/ui-plugin-bundler-kit";
|
|
63
|
-
*
|
|
64
|
-
* export default rsbuildConfig({
|
|
65
|
-
* rsbuild: {
|
|
66
|
-
* // your custom rsbuild config
|
|
67
|
-
* },
|
|
68
|
-
* });
|
|
69
|
-
* ```
|
|
70
|
-
* @param config
|
|
71
|
-
* @returns
|
|
72
|
-
*/
|
|
73
|
-
declare function rsbuildConfig(config?: RsBuildUserConfig): _rsbuild_core_dist_types_loadConfig.RsbuildConfigSyncFn;
|
|
74
|
-
|
|
75
|
-
export { HaloUIPluginBundlerKit, rsbuildConfig, viteConfig };
|