12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- import { defineConfig, loadEnv } from "vite";
- import vue from "@vitejs/plugin-vue";
- import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
- import vueJsx from "@vitejs/plugin-vue-jsx";
- import { resolve } from "path";
- function pathResolve(dir) {
- return resolve(process.cwd(), ".", dir);
- }
- export default defineConfig(({ command, mode }) => {
- return {
- resolve: {
- alias: [{
- find: "@",
- replacement: pathResolve("src"),
- },],
- dedupe: ["vue"],
- },
- plugins: [
- vue(),
- vueJsx(),
- createSvgIconsPlugin({
-
- iconDirs: [resolve(process.cwd(), "src/assets/svg")],
-
- symbolId: "icon-[dir]-[name]",
- })
- ],
-
- css: {
-
- preprocessorOptions: {
- less: {
- charset: false,
- modifyVars: {
- "arcoblue-6": "#d1402f",
- },
- javascriptEnabled: true,
- additionalData: '@import "@/assets/css/theme.less";@import "@/assets/css/global.less";',
- },
- },
- },
- build: {
- minify: true,
- target: "es2015",
-
- chunkSizeWarningLimit: 5000,
- rollupOptions: {
- external: [],
-
- output: {
- chunkFileNames: "static/js/[name]-[hash].js",
- entryFileNames: "static/js/[name]-[hash].js",
- assetFileNames: "static/[ext]/[name]-[hash].[ext]",
- },
- },
- },
- server: {
- port: 8088,
- host: "0.0.0.0",
- open: true,
- cors: true,
- hmr: true,
- proxy: {
- "/api": {
- target: "http://110.41.171.203:3001",
- changeOrigin: true,
- ws: true,
- secure: true,
- },
- },
- },
- }
- });
|