123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- 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 { visualizer } from "rollup-plugin-visualizer";
- import viteCompression from "vite-plugin-compression";
- export default defineConfig({
- base: "./",
- resolve: {},
-
- plugins: [
-
-
-
-
-
-
-
-
-
-
-
- legacy({
- targets: ["Chrome 63"],
- additionalLegacyPolyfills: ["regenerator-runtime/runtime"],
- modernPolyfills: true,
- }),
- vue(),
- vueJsx(),
- visualizer({ open: true }),
- ],
- css: {
- postcss: {
- plugins: [
- postCssPxToRem({
- rootValue: 37.5,
- propList: ["*"],
- selectorBlackList: [".norem"],
- }),
- ],
- },
- },
- build: {
- minify: 'terser',
- terserOptions: {
- compress: {
-
-
- drop_debugger: true,
- }
- },
- rollupOptions: {
- input: {
- instrument: resolve(__dirname, "instrument.html"),
- },
- output: {
-
- manualChunks(id) {
- if (id.includes("osmd-extended")) {
-
- return id
- .toString()
- .split("osmd-extended/")[1]
- .split("/")[0]
- .toString();
- }
- },
- chunkFileNames: "js/[name]-[hash].js",
- entryFileNames: "js/[name]-[hash].js",
- assetFileNames: "[ext]/[name]-[hash].[ext]",
- },
- },
- },
- server: {
- cors: true,
- port: 3000,
-
- proxy: {
- "^/instrument/.*": {
-
-
-
-
- target: "https://test.kt.colexiu.com",
-
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/instrument/, ""),
- },
- },
- },
- preview: {
- port: 3000,
- host: "192.168.3.114",
- },
- });
|