⬆️ (vue-i18n) add Vite plugin

This commit is contained in:
Julien Calixte
2023-07-01 23:32:13 +02:00
parent 05d1af7c05
commit d067d5cd49
3 changed files with 172 additions and 51 deletions

View File

@@ -1,13 +1,25 @@
import vue from '@vitejs/plugin-vue'
import path from 'path'
import { defineConfig } from 'vite'
import { UserConfigExport } from 'vitest/dist/config'
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'node-fetch': 'isomorphic-fetch'
export default defineConfig(({ command }) => {
const config: UserConfigExport = {
plugins: [vue(), VueI18nPlugin({})],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'node-fetch': 'isomorphic-fetch'
}
}
}
if (command === 'serve') {
config.define = {
global: {}
}
}
return config
})