1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- 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";
- // https://vitejs.dev/config/
- 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,
- // resolveStyle: (name) => ,
- },
- ],
- }),
- ],
- 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"),
- },
- },
- },
- 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/, ""),
- },
- },
- },
- preview:{
- port: 3010,
- }
- });
- // vite.config.js
|