zhengyiming
2025-03-13 07d73df3d817d01ce47f6c7b7a8d8514cd389295
apps/taro/config/index.js
@@ -24,6 +24,12 @@
  },
  alias: {
    '@': path.resolve(__dirname, '..', 'src'),
    '@life-payment/components': path.resolve(
      __dirname,
      '..',
      'node_modules',
      '@life-payment/components'
    ),
  },
  sourceRoot: 'src',
  outputRoot: `dist/${process.env.TARO_ENV}`,
@@ -92,7 +98,7 @@
      url: {
        enable: true,
        config: {
          limit: 1024, // 设定转换尺寸上限
          limit: 2024, // 设定转换尺寸上限
        },
      },
      cssModules: {
@@ -187,6 +193,17 @@
  h5: {
    publicPath: '/',
    staticDirectory: 'static',
    router: {
      mode: 'browser',
    },
    devServer: {
      proxy: {
        '/api': {
          target: 'http://localhost:57190', // 目标服务器地址
          changeOrigin: true,
        },
      },
    },
    postcss: {
      autoprefixer: {
        enable: true,
@@ -195,7 +212,7 @@
      url: {
        enable: true,
        config: {
          limit: 1024, // 设定转换尺寸上限
          limit: 2024, // 设定转换尺寸上限
        },
      },
      cssModules: {
@@ -206,6 +223,10 @@
        },
      },
    },
    htmlPluginOption: {
      favicon: './public/logo-v.png',
    },
    useHtmlComponents: true,
    webpackChain(chain, webpack) {
      chain.plugin('unplugin-auto-import').use(
        AutoImport({