123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- 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";
- import { createStyleImportPlugin } from "vite-plugin-style-import";
- import mkcert from "vite-plugin-mkcert";
- export default defineConfig({
- base: "./",
- resolve: {},
- plugins: [
- mkcert(),
- legacy({
- targets: 'last 2 versions and not dead, > 0.3%, Firefox ESR'
- }),
- vue(),
- vueJsx(),
- createStyleImportPlugin({
- libs: [
- {
- libraryName: "vant",
- esModule: true,
-
- },
- ],
- }),
- ],
- 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,
-
- proxy: {
- "^/gym/.*": {
- target: "https://mstutest.dayaedu.com",
-
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/gym/, ""),
- },
- "^/colexiu/.*": {
- target: "https://dev.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",
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/instrument/, ""),
- },
- },
- },
- preview:{
- port: 3010,
- }
- });
|