40 lines
1.0 KiB
TypeScript
40 lines
1.0 KiB
TypeScript
import { defineConfig } from 'vite';
|
|
import vue from '@vitejs/plugin-vue';
|
|
import { resolve } from 'path';
|
|
|
|
function pathResolve(dir: string) {
|
|
return resolve(process.cwd(), '.', dir);
|
|
}
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
css: {
|
|
preprocessorOptions: {
|
|
less: {
|
|
javascriptEnabled: true,
|
|
},
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: [
|
|
{
|
|
find: /\/@\//,
|
|
replacement: pathResolve('src') + '/',
|
|
},
|
|
],
|
|
extensions: ['.js', '.ts', '.mjs', '.vue', '.json', '.less', '.css'],
|
|
},
|
|
server: {
|
|
host: true,
|
|
https: false,
|
|
},
|
|
optimizeDeps: {
|
|
esbuildOptions: {
|
|
target: 'es2020',
|
|
},
|
|
// @iconify/iconify: The dependency is dynamically and virtually loaded by @purge-icons/generated, so it needs to be specified explicitly
|
|
include: ['lodash-es', 'ant-design-vue/es/locale/zh_CN', 'ant-design-vue/es/locale/en_US'],
|
|
},
|
|
});
|