12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- 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({
- 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,
- proxy: {
- "^/gym/.*": {
- target: "https://mstutest.dayaedu.com",
- // target: "https://online.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://test.lexiaoya.cn",
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/orchestra/, ""),
- },
- },
- },
- preview:{
- port: 3010
- }
- });
- // vite.config.js
|