zhengyiming
4 天以前 8528852ee8533fbd9c31a6d10364f1806ad09e1e
apps/cMiniApp/config/index.js
@@ -111,7 +111,13 @@
      chain.plugin('unplugin-auto-import').use(
        AutoImport({
          imports: ['vue', 'pinia', 'vue-router', { '@/constants': ['RouterPath'] }],
          dirs: ['./src/constants/**', './src/hooks/**'],
          // dirsScanOptions: {
          //   fileFilter: (file) => file.endsWith('.ts'), // Filter files
          //   types: true,
          // },
          vueTemplate: true,
          imports: ['vue', 'pinia', 'vue-router'],
          eslintrc: {
            enabled: true, // Default `false`
            filepath: './.eslintrc-auto-import.json', // Default `./.eslintrc-auto-import.json`
@@ -128,22 +134,24 @@
        })
      );
      chain.merge({
        plugin: {
          install: {
            plugin: require('terser-webpack-plugin'),
            args: [
              {
                terserOptions: {
                  compress: true, // 默认使用terser压缩
                  keep_classnames: true, // 不改变class名称
                  keep_fnames: true, // 不改变函数名称
      if (process.env.NODE_ENV !== 'development') {
        chain.merge({
          plugin: {
            install: {
              plugin: require('terser-webpack-plugin'),
              args: [
                {
                  terserOptions: {
                    compress: true, // 默认使用terser压缩
                    keep_classnames: true, // 不改变class名称
                    keep_fnames: true, // 不改变函数名称
                  },
                },
              },
            ],
              ],
            },
          },
        },
      });
        });
      }
      chain.merge({
        optimization: {