zhengnaiwen_citu 3 months ago
parent
commit
d6f1a90ff1
1 changed files with 30 additions and 29 deletions
  1. 30 29
      vue.config.js

+ 30 - 29
vue.config.js

@@ -107,30 +107,31 @@ module.exports = defineConfig({
       {
         test: /\.pug$/,
         loader: 'pug-plain-loader'
-      },
+      }
       // 确保所有 JS 文件都经过 Babel 转译
-      {
-        test: /\.js$/,
-        include: [
-          // 特别包含可能有问题的 node_modules
-          /node_modules\/element-ui/,
-          /node_modules\/vue/,
-          /node_modules\/axios/,
-          /node_modules\/@wangeditor/
-        ],
-        use: {
-          loader: 'babel-loader',
-          options: {
-            presets: [
-              ['@babel/preset-env', {
-                targets: { ie: '11' },
-                useBuiltIns: 'usage',
-                corejs: 3
-              }]
-            ]
-          }
-        }
-      })
+      // {
+      //   test: /\.js$/,
+      //   include: [
+      //     // 特别包含可能有问题的 node_modules
+      //     /node_modules\/element-ui/,
+      //     /node_modules\/vue/,
+      //     /node_modules\/axios/,
+      //     /node_modules\/@wangeditor/
+      //   ],
+      //   use: {
+      //     loader: 'babel-loader',
+      //     options: {
+      //       presets: [
+      //         ['@babel/preset-env', {
+      //           targets: { ie: '11' },
+      //           useBuiltIns: 'usage',
+      //           corejs: 3
+      //         }]
+      //       ]
+      //     }
+      //   }
+      // }
+    )
     if (process.env.NODE_ENV === 'production') {
       const TerserPlugin = require('terser-webpack-plugin')
       config.optimization.minimizer = [
@@ -192,7 +193,7 @@ module.exports = defineConfig({
   },
   // babel-loader 是否处理 node_modules 中的依赖包,处理哪些依赖包,参数类型: boolean | Array<string | RegExp>
   transpileDependencies: [
-    /[\\/]node_modules[\\/]/ // 转译所有 node_modules 中的依赖
+    // /[\\/]node_modules[\\/]/ // 转译所有 node_modules 中的依赖
     // Vue 相关
     // 'vue',
     // 'vuex',
@@ -208,7 +209,7 @@ module.exports = defineConfig({
 
     // '@mdi/font',
 
-    // 'scrolling-element',
+    'scrolling-element',
 
     // // 其他可能包含 ES6 代码的依赖
     // 'fs',
@@ -216,12 +217,12 @@ module.exports = defineConfig({
     // 'axios',
     // 'lodash',
     // 'echarts',
-    // 'decimal.js',
-    // 'nprogress',
-    // 'element-resize-detector',
+    'decimal.js',
+    'nprogress',
+    'element-resize-detector',
 
     // // 使用正则匹配更广泛的包
-    // /node_modules\/@wangeditor/,
+    /node_modules\/@wangeditor/
     // /node_modules\/vue-/,
     // /node_modules\/element-ui/,
     // /node_modules\/echarts/