12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- import { defineConfig } from "vite";
- import path from "path";
- import react from "@vitejs/plugin-react";
- import vitePluginImp from "vite-plugin-imp";
-
- // https://vitejs.dev/config/
- export default defineConfig({
- server: {
- port: 3001,
- host: "0.0.0.0",
- proxy: {
- '/api': {
- target: 'http://192.168.89.25:9111',
- changeOrigin: true,
- },
- },
- },
- plugins: [
- react(),
- vitePluginImp({
- libList: [
- {
- libName: "antd",
- style: (name) => `antd/es/${name}/style`,
- },
- ],
- })
- ],
- resolve: {
- alias: [{ find: "@", replacement: path.resolve(__dirname, "src") }],
- },
- css: {
- preprocessorOptions: {
- less: {
- // modifyVars: { 'primary-color': '#13c2c2' },
- javascriptEnabled: true,
- },
- },
- },
- build: {
- outDir: 'dist', // 打包输出目录
- assetsDir: 'assets', // 静态资源目录 (相对于 outputDir)
- minify: true, // 是否进行代码压缩
-
- }
- });
|