59 lines
1.3 KiB
TypeScript
59 lines
1.3 KiB
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
import Components from "unplugin-vue-components/vite";
|
|
import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";
|
|
|
|
// @ts-ignore
|
|
import pluginRewriteAll from 'vite-plugin-rewrite-all';
|
|
|
|
// Development mode:
|
|
// npm run dev # Run frontend that proxies to dev_backend
|
|
// cista -l :8000 --dev # Run backend
|
|
const dev_backend = {
|
|
target: "http://localhost:8000",
|
|
changeOrigin: false, // Use frontend "host" to match "origin" from browser
|
|
ws: true,
|
|
}
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
pluginRewriteAll(),
|
|
// Ant Design configuration
|
|
Components({
|
|
resolvers: [
|
|
AntDesignVueResolver({ importStyle:"less" })
|
|
],
|
|
}),
|
|
],
|
|
css: {
|
|
preprocessorOptions: {
|
|
less: {
|
|
modifyVars: {},
|
|
javascriptEnabled: true,
|
|
},
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
},
|
|
server: {
|
|
proxy: {
|
|
"/api": dev_backend,
|
|
"/files": dev_backend,
|
|
"/login": dev_backend,
|
|
"/logout": dev_backend,
|
|
}
|
|
},
|
|
build: {
|
|
outDir: "../cista/wwwroot",
|
|
emptyOutDir: true,
|
|
}
|
|
})
|