vbv/client/vite.config.ts

54 lines
1.3 KiB
TypeScript

import { fileURLToPath, URL } from "url";
import { defineConfig, loadEnv } from "vite";
import vue from "@vitejs/plugin-vue";
// import vueI18n from '@intlify/vite-plugin-vue-i18n'
import alias from "@rollup/plugin-alias";
// 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
alias({
// TODO: why is that used?
// entries: [
// {
// find: 'vue-i18n',
// replacement: path.resolve(__dirname, './node_modules/vue-i18n/dist/vue-i18n.runtime.esm-bundler.js')
// }
// ]
}),
],
server: {
port: 5173,
hmr: { port: 5173 }
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
build: {
assetsDir: 'static/vue',
},
test: {
globals: true,
environment: 'jsdom',
},
}
})