zhengyiming
9 天以前 1ba3a11308cf59c513d70fbc3608961f19a02621
apps/taro/config/index.js
@@ -98,7 +98,7 @@
      url: {
        enable: true,
        config: {
          limit: 1024, // 设定转换尺寸上限
          limit: 2024, // 设定转换尺寸上限
        },
      },
      cssModules: {
@@ -116,7 +116,13 @@
      chain.plugin('unplugin-auto-import').use(
        AutoImport({
          imports: ['vue', 'pinia', 'vue-router', { '@/constants': ['RouterPath'] }],
          imports: [
            'vue',
            'pinia',
            'vue-router',
            { '@/constants': ['RouterPath'] },
            { '@/utils': ['RouteHelper'] },
          ],
          eslintrc: {
            enabled: true, // Default `false`
            filepath: './.eslintrc-auto-import.json', // Default `./.eslintrc-auto-import.json`
@@ -196,6 +202,14 @@
    router: {
      mode: 'browser',
    },
    devServer: {
      proxy: {
        '/api': {
          target: 'http://localhost:58190', // 目标服务器地址
          changeOrigin: true,
        },
      },
    },
    postcss: {
      autoprefixer: {
        enable: true,
@@ -204,7 +218,7 @@
      url: {
        enable: true,
        config: {
          limit: 1024, // 设定转换尺寸上限
          limit: 2024, // 设定转换尺寸上限
        },
      },
      cssModules: {
@@ -215,10 +229,20 @@
        },
      },
    },
    htmlPluginOption: {
      favicon: './public/logo-v.png',
    },
    useHtmlComponents: true,
    webpackChain(chain, webpack) {
      chain.plugin('unplugin-auto-import').use(
        AutoImport({
          imports: ['vue', 'pinia', 'vue-router', { '@/constants': ['RouterPath'] }],
          imports: [
            'vue',
            'pinia',
            'vue-router',
            { '@/constants': ['RouterPath'] },
            { '@/utils': ['RouteHelper'] },
          ],
          eslintrc: {
            enabled: true, // Default `false`
            filepath: './.eslintrc-auto-import.json', // Default `./.eslintrc-auto-import.json`
@@ -227,6 +251,10 @@
        })
      );
      chain.toConfig().module.rules.forEach((rule) => {
        console.log('rule', JSON.stringify(rule));
      });
      chain.plugin('unplugin-vue-components').use(
        ComponentsPlugin({
          include: [/\.[tj]sx?$/, /\.vue$/, /\.vue\?vue/],