Quellcode durchsuchen

feat: enable tree-shaking (#3350)

* feat: enable tree-shaking

* bump umi's version to disable netlify's cache
chencheng (云谦) vor 7 Jahren
Ursprung
Commit
b3d2d6d9be
2 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen
  1. 2 0
      config/config.js
  2. 2 2
      package.json

+ 2 - 0
config/config.js

@@ -20,6 +20,7 @@ const plugins = [
       },
       dynamicImport: {
         loadingComponent: './components/PageLoading/index',
+        webpackChunkName: true,
       },
       pwa: {
         workboxPluginMode: 'InjectManifest',
@@ -57,6 +58,7 @@ export default {
   define: {
     APP_TYPE: process.env.APP_TYPE || '',
   },
+  treeShaking: true,
   targets: {
     ie: 11,
   },

+ 2 - 2
package.json

@@ -95,9 +95,9 @@
     "tslint": "^5.10.0",
     "tslint-config-prettier": "^1.10.0",
     "tslint-react": "^3.6.0",
-    "umi": "^2.3.1",
+    "umi": "^2.3.5",
     "umi-plugin-ga": "^1.1.3",
-    "umi-plugin-react": "^1.2.0"
+    "umi-plugin-react": "^1.3.4"
   },
   "optionalDependencies": {
     "puppeteer": "^1.10.0"