Przeglądaj źródła

🔧 chore(config): 配置 mini 编译包含规则

- 添加 mini.compile.include 规则
- 使用正则表达式确保排除特定 node_modules 包以保证产物为 es5 格式
yourname 3 miesięcy temu
rodzic
commit
7e47f35a56
1 zmienionych plików z 8 dodań i 1 usunięć
  1. 8 1
      mini/config/dev.ts

+ 8 - 1
mini/config/dev.ts

@@ -5,7 +5,14 @@ export default {
     quiet: false,
     stats: true
   },
-  mini: {},
+  mini: {
+    compile: {
+      include: [
+        // 确保产物为 es5
+        filename => /node_modules\/(?!(@babel|core-js|style-loader|css-loader|react|react-dom))/.test(filename)
+      ]
+    },
+  },
   h5: {
     devServer: {
       // 配置 HMR WebSocket 端口