swirl/ui/vite.config.ts

39 lines
865 B
TypeScript
Raw Normal View History

2021-12-22 10:05:53 +00:00
import { defineConfig, loadEnv } from 'vite'
2021-12-06 12:24:22 +00:00
import vue from '@vitejs/plugin-vue'
import path from 'path'
2021-12-22 10:05:53 +00:00
const config = loadEnv('development', './')
2021-12-06 12:24:22 +00:00
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
vue: "vue/dist/vue.esm-bundler.js",
'vue-i18n': "vue-i18n/dist/vue-i18n.cjs.js",
'@': path.resolve(__dirname, './src'),
}
},
build: {
cssCodeSplit: false,
// rollupOptions: {
// output: {
// manualChunks(id) {
// if (id.includes('node_modules')) {
// return id.toString().split('node_modules/')[1].split('/')[0].toString();
// }
// }
// }
// },
},
server: {
port: 3002,
proxy: {
'/api': {
2021-12-22 10:05:53 +00:00
target: 'http://' + config.VITE_PROXY_URL,
2021-12-06 12:24:22 +00:00
changeOrigin: true,
},
}
},
})