import { defineConfig } from "vite"; import vue from "@vitejs/plugin-vue"; import vueJsx from "@vitejs/plugin-vue-jsx"; import legacy from "@vitejs/plugin-legacy"; import { resolve } from "path"; import postCssPxToRem from "postcss-pxtorem"; // https://vitejs.dev/config/ export default defineConfig({ base: "./", resolve: {}, plugins: [ // mkcert(), // 本地https legacy({ targets: ['Chrome 63'], additionalLegacyPolyfills: ['regenerator-runtime/runtime'], modernPolyfills: true }), vue(), vueJsx(), ], css: { postcss: { plugins: [ postCssPxToRem({ rootValue: 37.5, propList: ["*"], selectorBlackList: [".norem"], }), ], }, }, build: { rollupOptions: { input: { index: resolve(__dirname, "index.html"), colexiu: resolve(__dirname, "colexiu.html"), orchestra: resolve(__dirname, "orchestra.html"), "report-share": resolve(__dirname, "report-share.html"), instrument: resolve(__dirname, "instrument.html"), }, }, }, server: { cors: true, port: 3000, // https: true, proxy: { "^/gym/.*": { target: "https://mstutest.dayaedu.com", // target: "https://online.dayaedu.com", changeOrigin: true, rewrite: (path) => path.replace(/^\/gym/, ""), }, "^/colexiu/.*": { target: "https://dev.colexiu.com", // target: "https://online.colexiu.com", changeOrigin: true, rewrite: (path) => path.replace(/^\/colexiu/, ""), }, "^/orchestra/.*": { target: "https://test.lexiaoya.cn", changeOrigin: true, rewrite: (path) => path.replace(/^\/orchestra/, ""), }, "^/instrument/.*": { // target: "https://kt.colexiu.com", target: "https://test.lexiaoya.cn", changeOrigin: true, rewrite: (path) => path.replace(/^\/instrument/, ""), }, }, }, preview:{ port: 3000, host: '192.168.3.114' } }); // vite.config.js