| | |
| | | import { resolve } from 'path' |
| | | import type {ConfigEnv, UserConfig} from 'vite' |
| | | import { loadEnv } from 'vite' |
| | | import type { UserConfig, ConfigEnv } from 'vite' |
| | | import { createVitePlugins } from './build/vite' |
| | | import { include, exclude } from "./build/vite/optimize" |
| | | import {exclude, include} from "./build/vite/optimize" |
| | | // 当前执行node命令时文件夹的地址(工作目录) |
| | | const root = process.cwd() |
| | | |
| | |
| | | css: { |
| | | preprocessorOptions: { |
| | | scss: { |
| | | additionalData: '@import "./src/styles/variables.scss";', |
| | | additionalData: '@use "@/styles/variables.scss" as *;', |
| | | javascriptEnabled: true |
| | | } |
| | | } |
| | |
| | | drop_debugger: env.VITE_DROP_DEBUGGER === 'true', |
| | | drop_console: env.VITE_DROP_CONSOLE === 'true' |
| | | } |
| | | }, |
| | | rollupOptions: { |
| | | output: { |
| | | manualChunks: { |
| | | echarts: ['echarts'] // 将 echarts 单独打包,参考 https://gitee.com/yudaocode/yudao-ui-admin-vue3/issues/IAB1SX 讨论 |
| | | } |
| | | }, |
| | | }, |
| | | }, |
| | | optimizeDeps: { include, exclude } |
| | | } |
| | | } |