Files
plugin-starter/admin-frontend/vite.config.ts
Ryan Wang ce38cdcad9 refactor: update admin frontend template
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-06-27 15:06:03 +08:00

38 lines
908 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/admin", import.meta.url)
),
emptyOutDir: true,
lib: {
entry: "src/index.ts",
name: "PluginTemplate",
formats: ["iife"],
fileName: () => "main.js",
},
rollupOptions: {
external: ["vue", "@halo-dev/shared", "@halo-dev/components"],
output: {
globals: {
vue: "Vue",
"@halo-dev/components": "HaloComponents",
"@halo-dev/admin-shared": "HaloAdminShared",
},
},
},
},
});