2025-11-20 13:10:28 +07:00
|
|
|
import { defineConfig } from "vite"
|
|
|
|
|
import { resolve } from "node:path"
|
|
|
|
|
import { fileURLToPath } from "node:url"
|
|
|
|
|
|
|
|
|
|
const __dirname = fileURLToPath(new URL(".", import.meta.url))
|
|
|
|
|
|
2024-05-13 11:25:12 +07:00
|
|
|
export default defineConfig({
|
|
|
|
|
build: {
|
2025-12-08 09:47:31 +07:00
|
|
|
lib: {
|
|
|
|
|
entry: {
|
|
|
|
|
global: resolve(__dirname, "assets/typescript/main.ts"),
|
|
|
|
|
},
|
|
|
|
|
formats: ["es"],
|
|
|
|
|
fileName: (format, entryName) => `${entryName}.js`,
|
|
|
|
|
},
|
|
|
|
|
outDir: "assets/script",
|
|
|
|
|
emptyOutDir: false,
|
2024-05-13 11:25:12 +07:00
|
|
|
rollupOptions: {
|
|
|
|
|
output: {
|
2025-12-08 09:47:31 +07:00
|
|
|
dir: "assets/script",
|
|
|
|
|
entryFileNames: "[name].js",
|
2025-11-20 13:10:28 +07:00
|
|
|
},
|
|
|
|
|
},
|
2024-05-13 11:25:12 +07:00
|
|
|
},
|
2025-11-20 13:10:28 +07:00
|
|
|
})
|