12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- import { defineConfig } from "vite";
- import vue from "@vitejs/plugin-vue";
- import vueJsx from "@vitejs/plugin-vue-jsx";
- import path from "path";
- import fs from "fs";
- const timestamp = + new Date()
- // https://vitejs.dev/config/
- export default defineConfig({
- plugins: [vue(), vueJsx({})],
- resolve: {
- alias: {
- "@": path.resolve(__dirname, "src"),
- },
- },
- build: {
- rollupOptions: {
- output: {
- entryFileNames: `assets/[name].${timestamp}.js`,
- chunkFileNames: `assets/[name].${timestamp}.js`,
- assetFileNames: `assets/[name].${timestamp}.[ext]`
- }
- }
- },
- server: {
- host: "jpcj-h5.zzxcx.net",
- port: 443,
- https: {
- key: fs.readFileSync("./cert/6353984_jpcj-h5.zzxcx.net.key"),
- cert: fs.readFileSync("./cert/6353984_jpcj-h5.zzxcx.net.pem"),
- },
- proxy: {
- "/dev-api": {
- target: "https://jpcj1.zzxcx.net/jpcj-admin",
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/dev-api/, ""),
- },
- "/prod-api": {
- target: "https://jpcj1.zzxcx.net/jpcj-admin",
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/prod-api/, ""),
- },
- },
- },
- });
|