1
jhzh
2026-05-22 ef52095f5e9f0a9fe2da779bb1573947d77d75b6
vite.config.js
@@ -7,6 +7,7 @@
import { visualizer } from 'rollup-plugin-visualizer'
import legacy from '@vitejs/plugin-legacy';
const scss_path = `@/assets/theme/index.scss`
const isVisualizer = process.env.VISUALIZER === 'show'
export default defineConfig({
  base: '',  //H5打包用
@@ -26,6 +27,7 @@
    preprocessorOptions: {
      scss: {
        additionalData: `@import "@/assets/css/variable.scss";`
        // additionalData: `@import "@/assets/css/variable.scss";@import "${scss_path}";`
      },
    }
  },
@@ -42,6 +44,12 @@
        // rewrite: (path) => path.replace(/^\/wap/, ""),
        secure: false
      },
      "/newsapi-api": {
        target: "https://newsapi.org",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/newsapi-api/, ''),
        secure: true
      },
    },
  },
  resolve: {