From 6c041d4a1f04be945ebffbdbeddf4b228d4195c3 Mon Sep 17 00:00:00 2001 From: Mikhala <122326421+imx-mikhala@users.noreply.github.com> Date: Fri, 1 Mar 2024 08:56:31 +0800 Subject: [PATCH] chore: Add visualizer plugin and script (#1550) --- packages/checkout/widgets-lib/.gitignore | 2 ++ packages/checkout/widgets-lib/package.json | 2 ++ yarn.lock | 24 ++++++++++++++++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/packages/checkout/widgets-lib/.gitignore b/packages/checkout/widgets-lib/.gitignore index 8bec29d3ee..80af08115b 100644 --- a/packages/checkout/widgets-lib/.gitignore +++ b/packages/checkout/widgets-lib/.gitignore @@ -24,3 +24,5 @@ yarn-error.log* cypress/videos/* +# visualizer +stats.html \ No newline at end of file diff --git a/packages/checkout/widgets-lib/package.json b/packages/checkout/widgets-lib/package.json index 60552e530e..219cb056fe 100644 --- a/packages/checkout/widgets-lib/package.json +++ b/packages/checkout/widgets-lib/package.json @@ -64,6 +64,7 @@ "react-scripts": "5.0.1", "rollup": "^3.17.2", "rollup-plugin-svg": "^2.0.0", + "rollup-plugin-visualizer": "^5.12.0", "ts-jest": "^29.1.0", "typescript": "^4.9.5", "web-vitals": "^2.1.4" @@ -78,6 +79,7 @@ "private": true, "scripts": { "build": "yarn clean && rollup --config rollup.config.js", + "build:analyse": "yarn build --plugin visualizer", "build:local": "yarn clean && yarn build && mkdir -p ../widgets-sample-app/public/lib/js && cp dist/*.js ../widgets-sample-app/public/lib/js/", "clean": "rm -rf ./dist", "lint": "eslint ./src --ext .ts,.jsx,.tsx --max-warnings=0", diff --git a/yarn.lock b/yarn.lock index e73b254bf2..8a205f9729 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3444,6 +3444,7 @@ __metadata: react-scripts: 5.0.1 rollup: ^3.17.2 rollup-plugin-svg: ^2.0.0 + rollup-plugin-visualizer: ^5.12.0 stream-browserify: ^3.0.0 stream-http: ^3.2.0 ts-jest: ^29.1.0 @@ -25351,6 +25352,25 @@ __metadata: languageName: node linkType: hard +"rollup-plugin-visualizer@npm:^5.12.0": + version: 5.12.0 + resolution: "rollup-plugin-visualizer@npm:5.12.0" + dependencies: + open: ^8.4.0 + picomatch: ^2.3.1 + source-map: ^0.7.4 + yargs: ^17.5.1 + peerDependencies: + rollup: 2.x || 3.x || 4.x + peerDependenciesMeta: + rollup: + optional: true + bin: + rollup-plugin-visualizer: dist/bin/cli.js + checksum: 17dc10a93d4bd457c8bb7796a57c284487fb00f4b9703a33a1a954f5d40c66a89b24aca98564569922456f4fa8f72281c3ef96a95502195e6930b3fac62fce8e + languageName: node + linkType: hard + "rollup-pluginutils@npm:^1.3.1": version: 1.5.2 resolution: "rollup-pluginutils@npm:1.5.2" @@ -26205,7 +26225,7 @@ __metadata: languageName: node linkType: hard -"source-map@npm:^0.7.3": +"source-map@npm:^0.7.3, source-map@npm:^0.7.4": version: 0.7.4 resolution: "source-map@npm:0.7.4" checksum: 01cc5a74b1f0e1d626a58d36ad6898ea820567e87f18dfc9d24a9843a351aaa2ec09b87422589906d6ff1deed29693e176194dc88bcae7c9a852dc74b311dbf5 @@ -29845,7 +29865,7 @@ __metadata: languageName: node linkType: hard -"yargs@npm:^17.3.1": +"yargs@npm:^17.3.1, yargs@npm:^17.5.1": version: 17.7.2 resolution: "yargs@npm:17.7.2" dependencies: