12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- 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, "colexiu.html"),
- orchestra: resolve(__dirname, "orchestra.html"),
- },
- },
- },
- server: {
- cors: true,
- port: 3000,
- proxy: {
- "^/gym/.*": {
- target: "https://mstutest.dayaedu.com",
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/gym/, ""),
- },
- "^/colexiu/.*": {
- target: "https://online.colexiu.com",
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/colexiu/, ""),
- },
- "^/orchestra/.*": {
- target: "https://online.lexiaoya.cn",
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/orchestra/, ""),
- },
- },
- },
- });
- // vite.config.js
|