无人机管理后台前端(已迁走)
张含笑
2025-08-05 c832bf2e80ac465e71b7a1c1f7a59d4252030989
vite.config.mjs
@@ -9,15 +9,6 @@
  // 判断是打生产环境包
  const isProd = VITE_APP_ENV === 'production'
  const mapApi = VITE_APP_ENV === 'development' ? {
    target: VITE_APP_URL,
    changeOrigin: true,
  } : {
    target: VITE_APP_URL,
    changeOrigin: true,
    rewrite: path => path.replace(/^\/api/, ''),
  }
  // 根据是否生产环境,动态设置压缩配置
  const buildConfig = {
    outDir: 'manage',
@@ -48,7 +39,11 @@
      port: 5174,
      // host: '192.168.1.178',
      proxy: {
        '/api': mapApi
        '/api': {
          target: VITE_APP_URL,
          changeOrigin: true,
          rewrite: path => path.replace(/^\/api/, ''),
        }
      },
    },
    resolve: {
@@ -61,6 +56,12 @@
      },
    },
    css: {
      preprocessorOptions: {
        scss: {
          api: 'modern-compiler',
          additionalData: `@use "@/styles/variables.scss" as *;`,
        },
      },
      postcss: {
        plugins: [
          postCssPxToRem({