123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- 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";
- // https://vitejs.dev/config/
- export default defineConfig({
- base: "./",
- resolve: {},
- plugins: [
- legacy(),
- vue(),
- vueJsx(),
- createStyleImportPlugin({
- libs: [
- {
- libraryName: "vant",
- esModule: true,
- // resolveStyle: (name) => ,
- },
- ],
- }),
- ],
- css: {
- postcss: {
- plugins: [
- postCssPxToRem({
- rootValue: 37.5,
- propList: ["*"],
- selectorBlackList: [".norem"],
- }),
- ],
- },
- },
- build: {
- target: "esnext",
- rollupOptions: {
- input: {
- index: resolve(__dirname, "index.html"),
- colexiu: resolve(__dirname, "index-colexiu.html"),
- orchestra: resolve(__dirname, "index-orchestra.html"),
- },
- },
- },
- server: {
- cors: true,
- proxy: {
- "^/gym/.*": {
- target: "https://mstutest.dayaedu.com",
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/gym/, ""),
- },
- "^/colexiu/.*": {
- target: "http://dev.colexiu.cn",
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/colexiu/, ""),
- },
- "^/orchestra/.*": {
- target: "https://test.lexiaoya.cn",
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/orchestra/, ""),
- },
- },
- },
- });
- // vite.config.js
|