61 lines
1.4 KiB
TypeScript
61 lines
1.4 KiB
TypeScript
import { fileURLToPath, URL } from 'node:url';
|
|
|
|
import { defineConfig } from 'vite';
|
|
import vue from '@vitejs/plugin-vue';
|
|
import vueDevTools from 'vite-plugin-vue-devtools';
|
|
import Components from 'unplugin-vue-components/vite';
|
|
import {
|
|
AntDesignVueResolver,
|
|
IduxResolver,
|
|
NaiveUiResolver
|
|
} from 'unplugin-vue-components/resolvers';
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
server: {
|
|
host: '0.0.0.0',
|
|
proxy: {
|
|
'/api': 'http://localhost:7546',
|
|
},
|
|
},
|
|
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
chunkFileNames: `[hash].js`,
|
|
entryFileNames: `[hash].js`,
|
|
assetFileNames: `[hash].[ext]`,
|
|
},
|
|
},
|
|
terserOptions: {
|
|
compress: {
|
|
drop_console: true,
|
|
drop_debugger: true,
|
|
},
|
|
},
|
|
},
|
|
plugins: [
|
|
vue(),
|
|
vueDevTools(),
|
|
Components({
|
|
resolvers: [
|
|
IduxResolver({
|
|
importStyle: 'css',
|
|
}),
|
|
NaiveUiResolver(),
|
|
AntDesignVueResolver({
|
|
resolveIcons: true,
|
|
importStyle: 'less',
|
|
}),
|
|
],
|
|
dts: 'src/types/components.auto.d.ts',
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
'@res': fileURLToPath(new URL('./src/resource', import.meta.url)),
|
|
'@com': fileURLToPath(new URL('./src/component', import.meta.url)),
|
|
},
|
|
},
|
|
});
|