yangfeng
2024-02-02 3a4b094461e11002287a667b8bea49b362a2fc6f
vite.config.ts
@@ -16,9 +16,9 @@
export default defineConfig({
  server: {
    proxy: {
      '/v1/': {
      '/api-s/': {
        // http://192.168.20.119:8003 http://192.168.20.25:7010
        target: 'http://192.168.20.119:8003',
        target: 'http://192.168.20.120:9081',
        ws: true,
        changeOrigin: true
      }
@@ -27,27 +27,26 @@
  resolve: {
    alias: {
      '@': pathSrc
    },
  },
  build: {
    minify:'terser',
    // ,'edge90','firefox90','safari15'
    target:['chrome52'],
    cssTarget:["chrome52"],
  },
  css:{
      postcss:{
          plugins:[
            require('postcss-pxtorem')({
              // ipad:1280-800
              rootValue:160.0, //换算的基数, 屏幕宽度/10
              propList:['*'],//需要转化的属性,*表示所有属性都需要转化
              // unitPrecision:5
            })
          ]
    }
  },
  build: {
    minify: 'terser',
    // ,'edge90','firefox90','safari15'
    target: ['chrome52'],
    cssTarget: ['chrome52']
  },
  css: {
    postcss: {
      plugins: [
        require('postcss-pxtorem')({
          // ipad:1280-800
          rootValue: 160.0, //换算的基数, 屏幕宽度/10
          propList: ['*'] //需要转化的属性,*表示所有属性都需要转化
          // unitPrecision:5
        })
      ]
    }
  },
  plugins: [
    vue(),
@@ -68,10 +67,10 @@
    }),
    // 开发环境兼容
    esbuild({
      target:"chrome64",
      loaders:{
        ".vue":'js',
        ".ts":'js'
      target: 'chrome64',
      loaders: {
        '.vue': 'js',
        '.ts': 'js'
      }
    }),
    // 兼容低版本浏览器
@@ -113,8 +112,8 @@
    }),
    Icons({
      autoInstall: true
    }),
  ],
    })
  ]
  // configureWebpack:config=>{
  //   config.entry.app=['babel-polyfill','./src/main.js']
  // },