From cb1948a3ff8766777ac895efe645618278ee5ff3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 13 Feb 2021 23:53:23 +0100 Subject: [PATCH] Add rollup bundling analysis to dev build. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- package-lock.json | 6 ++++++ package.json | 4 +++- rollup.config.js | 4 +++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 76bfedd8..c2084424 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8058,6 +8058,12 @@ "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", diff --git a/package.json b/package.json index b8ac08ad..dc329d53 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/rollup.config.js b/rollup.config.js index 37bc6799..16624fce 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -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() ] }; -- 2.34.1