Files
plugin-starter/console/vite.config.ts
Ryan Wang dace6d7ed5 refactor: rename admin-frontend to console (#5)
1. 将 `admin-frontend` 文件夹改为 `console`。
2. 构建后台的静态资源输出目录改为 `src/main/resources/console`

/kind improvement

```release-note
None
```
2022-10-09 09:14:28 +00:00

44 lines
1005 B
TypeScript

import { fileURLToPath, URL } from "url";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx()],
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: "PluginStarter",
formats: ["iife"],
fileName: () => "main.js",
},
rollupOptions: {
external: [
"vue",
"@halo-dev/shared",
"@halo-dev/components",
"vue-router",
],
output: {
globals: {
vue: "Vue",
"vue-router": "VueRouter",
"@halo-dev/components": "HaloComponents",
"@halo-dev/console-shared": "HaloConsoleShared",
},
},
},
},
});