Add rollup bundling analysis to dev build.
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 13 Feb 2021 22:53:23 +0000 (23:53 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 13 Feb 2021 22:53:23 +0000 (23:53 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
package-lock.json
package.json
rollup.config.js

index 76bfedd88c6ede6daf68c3220c84449645295bf5..c20844244d05d49ce34a4513c79af148db027075 100644 (file)
         "fsevents": "~2.3.1"
       }
     },
+    "rollup-plugin-analyzer": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/rollup-plugin-analyzer/-/rollup-plugin-analyzer-4.0.0.tgz",
+      "integrity": "sha512-LL9GEt3bkXp6Wa19SNR5MWcvHNMvuTFYg+eYBZN2OIFhSWN+pEJUQXEKu5BsOeABob3x9PDaLKW7w5iOJnsESQ==",
+      "dev": true
+    },
     "rollup-plugin-copy": {
       "version": "3.3.0",
       "resolved": "https://registry.npmjs.org/rollup-plugin-copy/-/rollup-plugin-copy-3.3.0.tgz",
index b8ac08ad62668e4aa38607c363601241f138afa7..dc329d53fe0ccdd0d5649129ec0f76d23772fd9e 100644 (file)
@@ -29,7 +29,8 @@
     "start:bubbleprof": "cross-env NODE_ENV=production clinic bubbleprof -- node -r source-map-support/register dist/start.js",
     "rollup": "rollup --config",
     "build": "npm run rollup",
-    "build:dev": "npm run rollup -- --watch --environment BUILD:development",
+    "build:dev": "npm run rollup -- --environment BUILD:development",
+    "build:dev:watch": "npm run rollup -- --environment BUILD:development --watch",
     "build:mta": "mbt build",
     "lint": "cross-env TIMING=1 eslint --ext .js,.ts src",
     "lint:fix": "cross-env TIMING=1 eslint --fix --ext .js,.ts src",
@@ -69,6 +70,7 @@
     "mbt": "^1.1.0",
     "npm-check": "^5.9.2",
     "rollup": "^2.39.0",
+    "rollup-plugin-analyzer": "^4.0.0",
     "rollup-plugin-copy": "^3.3.0",
     "rollup-plugin-delete": "^2.0.0",
     "rollup-plugin-typescript2": "^0.29.0",
index 37bc67999fa8034f1e2d9035eca94ef065d7148d..16624fced18a1d063567805f42f069b6a20ae270 100644 (file)
@@ -1,3 +1,4 @@
+import analyze from 'rollup-plugin-analyzer';
 import copy from 'rollup-plugin-copy';
 import del from 'rollup-plugin-delete';
 import typescript from 'rollup-plugin-typescript2';
@@ -26,6 +27,7 @@ export default {
       targets: [
         { src: 'src/assets', dest: 'dist/' }
       ]
-    })
+    }),
+    isDevelopmentBuild && analyze()
   ]
 };