chore: simplify bundler config (#117)

使用 `@halo-dev/ui-plugin-bundler-kit` 简化构建配置。

/kind improvement

```release-note
None
```
This commit is contained in:
Ryan Wang
2024-02-05 10:56:31 +08:00
committed by GitHub
parent 2b0dd98575
commit 11cbfdb9bb
4 changed files with 21 additions and 34 deletions

View File

@@ -36,7 +36,7 @@ configurations.runtimeClasspath {
halo {
version = '2.10.1'
version = '2.12.1'
}
haloPlugin {

View File

@@ -21,6 +21,7 @@
"vue": "^3.3.4"
},
"devDependencies": {
"@halo-dev/ui-plugin-bundler-kit": "^2.12.0",
"@iconify/json": "^2.2.18",
"@rushstack/eslint-patch": "^1.2.0",
"@types/canvas-confetti": "^1.6.0",

12
console/pnpm-lock.yaml generated
View File

@@ -31,6 +31,9 @@ dependencies:
version: 3.3.7(typescript@4.7.4)
devDependencies:
'@halo-dev/ui-plugin-bundler-kit':
specifier: ^2.12.0
version: 2.12.0(vite@3.1.8)
'@iconify/json':
specifier: ^2.2.18
version: 2.2.18
@@ -582,6 +585,15 @@ packages:
vue-router: 4.2.5(vue@3.3.7)
dev: false
/@halo-dev/ui-plugin-bundler-kit@2.12.0(vite@3.1.8):
resolution: {integrity: sha512-3558qzH5RN9pB2j0ZonuIxX3cw8lh870cWpPPHjkDxTIjKt+aO5tjKhcqKlFL853jdx9nHIIS+nMDCeqjejpxw==}
engines: {node: ^18.0.0 || >=20.0.0}
peerDependencies:
vite: ^4.0.0 || ^5.0.0
dependencies:
vite: 3.1.8(sass@1.58.0)
dev: true
/@humanwhocodes/config-array@0.11.6:
resolution: {integrity: sha512-jJr+hPTJYKyDILJfhNSHsjiwXYf26Flsz8DvNndOsHs5pwSnpGUEy8yzF0JYhCEvTDdV2vuOK5tt8BVhwO5/hg==}
engines: {node: '>=10.10.0'}

View File

@@ -4,44 +4,18 @@ import { defineConfig } from "vite";
import Vue from "@vitejs/plugin-vue";
import VueJsx from "@vitejs/plugin-vue-jsx";
import Icons from "unplugin-icons/vite";
import { HaloUIPluginBundlerKit } from "@halo-dev/ui-plugin-bundler-kit";
const pluginEntryName = "PluginS3ObjectStorage";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [Vue(), VueJsx(), Icons({ compiler: "vue3" })],
plugins: [
Vue(),
VueJsx(),
Icons({ compiler: "vue3" }),
HaloUIPluginBundlerKit(),
],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
build: {
outDir: fileURLToPath(
new URL("../src/main/resources/console", import.meta.url)
),
emptyOutDir: true,
lib: {
entry: "src/index.ts",
name: pluginEntryName,
formats: ["iife"],
fileName: () => "main.js",
},
rollupOptions: {
external: [
"vue",
"@halo-dev/console-shared",
"@halo-dev/components",
"vue-router",
],
output: {
globals: {
vue: "Vue",
"vue-router": "VueRouter",
"@halo-dev/components": "HaloComponents",
"@halo-dev/console-shared": "HaloConsoleShared",
},
extend: true,
},
},
},
});