45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import { fileURLToPath, URL } from "node:url";
|
|
|
|
import vue from "@vitejs/plugin-vue";
|
|
import { defineConfig, loadEnv } from "vite";
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig(({ mode }) => {
|
|
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
|
|
return {
|
|
plugins: [
|
|
vue({
|
|
template: {
|
|
compilerOptions: {
|
|
// treat all tags which start with '<it-' as custom elements
|
|
isCustomElement: (tag) => tag.startsWith("it-"),
|
|
},
|
|
},
|
|
}),
|
|
// vueI18n({
|
|
// include: path.resolve(__dirname, './locales/**')
|
|
// }),
|
|
// won't work in vite's resolve.alias, so we'll make the alias here
|
|
],
|
|
define: {},
|
|
server: {
|
|
host: true,
|
|
port: 5173,
|
|
strictPort: true,
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
|
},
|
|
},
|
|
build: {
|
|
assetsDir: "static/vue",
|
|
},
|
|
test: {
|
|
globals: true,
|
|
environment: "jsdom",
|
|
setupFiles: ["./vitest.setup.ts"],
|
|
},
|
|
};
|
|
});
|