From 6c94880497081114a8c374bbbc32554f167aecf2 Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Wed, 15 Dec 2021 14:47:49 +0100 Subject: [PATCH] Make output bundles smaller by smarter importing icons --- .vscodeignore | 1 + package-lock.json | 322 +++++++++++++++++- package.json | 7 +- .../components/ChoiceButton.tsx | 2 +- .../components/Contents/Overview.tsx | 2 +- .../components/Header/Breadcrumb.tsx | 2 +- .../components/Header/ClearFilters.tsx | 2 +- .../components/Header/Filter.tsx | 2 +- .../components/Header/Header.tsx | 2 +- .../components/Header/Searchbox.tsx | 2 +- .../components/Header/ViewSwitch.tsx | 3 +- .../components/Media/FolderCreation.tsx | 2 +- .../components/Media/FolderItem.tsx | 2 +- .../components/Media/Item.tsx | 2 +- .../components/Media/Media.tsx | 2 +- .../components/Media/MenuButton.tsx | 2 +- .../components/Media/Pagination.tsx | 2 +- .../components/Menu/MenuButton.tsx | 2 +- .../components/Modals/Alert.tsx | 2 +- .../components/SponsorMsg.tsx | 3 +- .../components/Steps/Step.tsx | 2 +- .../components/Steps/StepsToGetStarted.tsx | 2 +- .../components/WelcomeScreen.tsx | 3 +- .../components/Fields/ChoiceButton.tsx | 2 +- .../components/Fields/ChoiceField.tsx | 3 +- .../components/Fields/DateTimeField.tsx | 2 +- .../components/Fields/ImageFallback.tsx | 2 +- .../components/Fields/NumberField.tsx | 2 +- .../components/Fields/PreviewImageField.tsx | 2 +- .../components/Fields/TextField.tsx | 2 +- webpack.config.js | 43 ++- 31 files changed, 399 insertions(+), 32 deletions(-) diff --git a/.vscodeignore b/.vscodeignore index 0c1c68c9..665aa6ee 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -22,3 +22,4 @@ assets/v2.* assets/v3.* assets/v4.* assets/sponsors +dist/*.html \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 43ef3b3e..fe4955c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -58,10 +58,11 @@ "url-join-ts": "^1.0.5", "wc-react": "github:estruyf/wc-react", "webpack": "4.44.2", + "webpack-bundle-analyzer": "^4.5.0", "webpack-cli": "3.3.12" }, "engines": { - "vscode": "^1.51.0" + "vscode": "^1.63.0" } }, "node_modules/@babel/code-frame": { @@ -239,6 +240,12 @@ "node": ">= 8" } }, + "node_modules/@polka/url": { + "version": "1.0.0-next.21", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.21.tgz", + "integrity": "sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==", + "dev": true + }, "node_modules/@popperjs/core": { "version": "2.10.1", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.10.1.tgz", @@ -2359,6 +2366,12 @@ "react": ">=16.8.0" } }, + "node_modules/duplexer": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", + "dev": true + }, "node_modules/duplexify": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", @@ -3280,6 +3293,21 @@ "node": ">=6.0" } }, + "node_modules/gzip-size": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-6.0.0.tgz", + "integrity": "sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==", + "dev": true, + "dependencies": { + "duplexer": "^0.1.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/hamt_plus": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/hamt_plus/-/hamt_plus-1.0.2.tgz", @@ -5098,6 +5126,15 @@ "rimraf": "bin.js" } }, + "node_modules/mrmime": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-1.0.0.tgz", + "integrity": "sha512-a70zx7zFfVO7XpnQ2IX1Myh9yY4UYvfld/dikWRnsXxbyvMcfz+u6UfgNAtH+k2QqtJuzVpv6eLTx1G2+WKZbQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -5409,6 +5446,15 @@ "wrappy": "1" } }, + "node_modules/opener": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", + "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", + "dev": true, + "bin": { + "opener": "bin/opener-bin.js" + } + }, "node_modules/os-browserify": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", @@ -6748,6 +6794,20 @@ "is-arrayish": "^0.3.1" } }, + "node_modules/sirv": { + "version": "1.0.19", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.19.tgz", + "integrity": "sha512-JuLThK3TnZG1TAKDwNIqNq6QA2afLOCcm+iE8D1Kj3GA40pSPsxQjjJl0J8X3tsR7T+CP1GavpzLwYkgVLWrZQ==", + "dev": true, + "dependencies": { + "@polka/url": "^1.0.0-next.20", + "mrmime": "^1.0.0", + "totalist": "^1.0.0" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -7584,6 +7644,15 @@ "node": ">=0.10.0" } }, + "node_modules/totalist": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-1.1.0.tgz", + "integrity": "sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/ts-loader": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.3.tgz", @@ -8292,6 +8361,108 @@ } } }, + "node_modules/webpack-bundle-analyzer": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.5.0.tgz", + "integrity": "sha512-GUMZlM3SKwS8Z+CKeIFx7CVoHn3dXFcUAjT/dcZQQmfSZGvitPfMob2ipjai7ovFFqPvTqkEZ/leL4O0YOdAYQ==", + "dev": true, + "dependencies": { + "acorn": "^8.0.4", + "acorn-walk": "^8.0.0", + "chalk": "^4.1.0", + "commander": "^7.2.0", + "gzip-size": "^6.0.0", + "lodash": "^4.17.20", + "opener": "^1.5.2", + "sirv": "^1.0.7", + "ws": "^7.3.1" + }, + "bin": { + "webpack-bundle-analyzer": "lib/bin/analyzer.js" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/webpack-bundle-analyzer/node_modules/acorn": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.6.0.tgz", + "integrity": "sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/webpack-bundle-analyzer/node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/webpack-bundle-analyzer/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/webpack-bundle-analyzer/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/webpack-bundle-analyzer/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/webpack-bundle-analyzer/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/webpack-bundle-analyzer/node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, "node_modules/webpack-cli": { "version": "3.3.12", "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.12.tgz", @@ -8624,6 +8795,27 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "node_modules/ws": { + "version": "7.5.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.6.tgz", + "integrity": "sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA==", + "dev": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", @@ -8819,6 +9011,12 @@ "fastq": "^1.6.0" } }, + "@polka/url": { + "version": "1.0.0-next.21", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.21.tgz", + "integrity": "sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==", + "dev": true + }, "@popperjs/core": { "version": "2.10.1", "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.10.1.tgz", @@ -10615,6 +10813,12 @@ "react-is": "^16.13.1" } }, + "duplexer": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", + "dev": true + }, "duplexify": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", @@ -11375,6 +11579,15 @@ "strip-bom-string": "^1.0.0" } }, + "gzip-size": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-6.0.0.tgz", + "integrity": "sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==", + "dev": true, + "requires": { + "duplexer": "^0.1.2" + } + }, "hamt_plus": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/hamt_plus/-/hamt_plus-1.0.2.tgz", @@ -12691,6 +12904,12 @@ } } }, + "mrmime": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-1.0.0.tgz", + "integrity": "sha512-a70zx7zFfVO7XpnQ2IX1Myh9yY4UYvfld/dikWRnsXxbyvMcfz+u6UfgNAtH+k2QqtJuzVpv6eLTx1G2+WKZbQ==", + "dev": true + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -12956,6 +13175,12 @@ "wrappy": "1" } }, + "opener": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", + "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", + "dev": true + }, "os-browserify": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", @@ -13978,6 +14203,17 @@ "is-arrayish": "^0.3.1" } }, + "sirv": { + "version": "1.0.19", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.19.tgz", + "integrity": "sha512-JuLThK3TnZG1TAKDwNIqNq6QA2afLOCcm+iE8D1Kj3GA40pSPsxQjjJl0J8X3tsR7T+CP1GavpzLwYkgVLWrZQ==", + "dev": true, + "requires": { + "@polka/url": "^1.0.0-next.20", + "mrmime": "^1.0.0", + "totalist": "^1.0.0" + } + }, "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -14654,6 +14890,12 @@ "is-number": "^7.0.0" } }, + "totalist": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-1.1.0.tgz", + "integrity": "sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g==", + "dev": true + }, "ts-loader": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.3.tgz", @@ -15391,6 +15633,77 @@ } } }, + "webpack-bundle-analyzer": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.5.0.tgz", + "integrity": "sha512-GUMZlM3SKwS8Z+CKeIFx7CVoHn3dXFcUAjT/dcZQQmfSZGvitPfMob2ipjai7ovFFqPvTqkEZ/leL4O0YOdAYQ==", + "dev": true, + "requires": { + "acorn": "^8.0.4", + "acorn-walk": "^8.0.0", + "chalk": "^4.1.0", + "commander": "^7.2.0", + "gzip-size": "^6.0.0", + "lodash": "^4.17.20", + "opener": "^1.5.2", + "sirv": "^1.0.7", + "ws": "^7.3.1" + }, + "dependencies": { + "acorn": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.6.0.tgz", + "integrity": "sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw==", + "dev": true + }, + "acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true + } + } + }, "webpack-cli": { "version": "3.3.12", "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.12.tgz", @@ -15535,6 +15848,13 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "ws": { + "version": "7.5.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.6.tgz", + "integrity": "sha512-6GLgCqo2cy2A2rjCNFlxQS6ZljG/coZfZXclldI8FB/1G3CCI36Zd8xy2HrFVACi8tfk5XrgLQEk+P0Tnz9UcA==", + "dev": true, + "requires": {} + }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", diff --git a/package.json b/package.json index 0193e54c..8c67cfb6 100644 --- a/package.json +++ b/package.json @@ -720,7 +720,11 @@ "error" ] }, - "default": ["info", "warning", "error"], + "default": [ + "info", + "warning", + "error" + ], "markdownDescription": "Specifies the notifications you want to see. By default, all notifications types will be shown. [Check in the docs](https://frontmatter.codes/docs/settings#frontMatter.global.notifications)", "scope": "Templates" } @@ -1193,6 +1197,7 @@ "url-join-ts": "^1.0.5", "wc-react": "github:estruyf/wc-react", "webpack": "4.44.2", + "webpack-bundle-analyzer": "^4.5.0", "webpack-cli": "3.3.12" } } diff --git a/src/dashboardWebView/components/ChoiceButton.tsx b/src/dashboardWebView/components/ChoiceButton.tsx index c027d36b..ca9a1322 100644 --- a/src/dashboardWebView/components/ChoiceButton.tsx +++ b/src/dashboardWebView/components/ChoiceButton.tsx @@ -1,5 +1,5 @@ import { Menu } from '@headlessui/react'; -import { ChevronDownIcon } from '@heroicons/react/outline'; +import ChevronDownIcon from '@heroicons/react/outline/ChevronDownIcon'; import * as React from 'react'; import { MenuItem, MenuItems } from './Menu'; diff --git a/src/dashboardWebView/components/Contents/Overview.tsx b/src/dashboardWebView/components/Contents/Overview.tsx index 4684e09b..a40fc2b2 100644 --- a/src/dashboardWebView/components/Contents/Overview.tsx +++ b/src/dashboardWebView/components/Contents/Overview.tsx @@ -1,5 +1,5 @@ import { Disclosure } from '@headlessui/react'; -import { ChevronRightIcon } from '@heroicons/react/solid'; +import ChevronRightIcon from '@heroicons/react/solid/ChevronRightIcon'; import * as React from 'react'; import { useRecoilValue } from 'recoil'; import { groupBy } from '../../../helpers/GroupBy'; diff --git a/src/dashboardWebView/components/Header/Breadcrumb.tsx b/src/dashboardWebView/components/Header/Breadcrumb.tsx index 936a4421..2c42fdfd 100644 --- a/src/dashboardWebView/components/Header/Breadcrumb.tsx +++ b/src/dashboardWebView/components/Header/Breadcrumb.tsx @@ -1,4 +1,4 @@ -import { CollectionIcon } from '@heroicons/react/outline'; +import CollectionIcon from '@heroicons/react/outline/CollectionIcon'; import { basename, join } from 'path'; import * as React from 'react'; import { useRecoilState, useRecoilValue } from 'recoil'; diff --git a/src/dashboardWebView/components/Header/ClearFilters.tsx b/src/dashboardWebView/components/Header/ClearFilters.tsx index 3695dacd..7fb6a6ce 100644 --- a/src/dashboardWebView/components/Header/ClearFilters.tsx +++ b/src/dashboardWebView/components/Header/ClearFilters.tsx @@ -1,4 +1,4 @@ -import { XCircleIcon } from '@heroicons/react/solid'; +import XCircleIcon from '@heroicons/react/solid/XCircleIcon'; import * as React from 'react'; import { useRecoilValue, useResetRecoilState } from 'recoil'; import { FolderSelector, TagSelector, CategorySelector, SortingAtom, FolderAtom, DEFAULT_FOLDER_STATE, TagAtom, CategoryAtom, DEFAULT_TAG_STATE, DEFAULT_CATEGORY_STATE } from '../../state'; diff --git a/src/dashboardWebView/components/Header/Filter.tsx b/src/dashboardWebView/components/Header/Filter.tsx index 15e985a2..fdc74787 100644 --- a/src/dashboardWebView/components/Header/Filter.tsx +++ b/src/dashboardWebView/components/Header/Filter.tsx @@ -1,5 +1,5 @@ import { Menu } from '@headlessui/react'; -import { FilterIcon } from '@heroicons/react/solid'; +import FilterIcon from '@heroicons/react/solid/FilterIcon'; import * as React from 'react'; import { MenuButton, MenuItem, MenuItems } from '../Menu'; diff --git a/src/dashboardWebView/components/Header/Header.tsx b/src/dashboardWebView/components/Header/Header.tsx index 0fbe9cbc..4daca819 100644 --- a/src/dashboardWebView/components/Header/Header.tsx +++ b/src/dashboardWebView/components/Header/Header.tsx @@ -14,7 +14,7 @@ import { CategoryAtom, DashboardViewAtom, SortingAtom, TagAtom } from '../../sta import { Messenger } from '@estruyf/vscode/dist/client'; import { ClearFilters } from './ClearFilters'; import { MarkdownIcon } from '../../../panelWebView/components/Icons/MarkdownIcon'; -import { PhotographIcon } from '@heroicons/react/outline'; +import PhotographIcon from '@heroicons/react/outline/PhotographIcon'; import { Pagination } from '../Media/Pagination'; import { ChoiceButton } from '../ChoiceButton'; import { Breadcrumb } from './Breadcrumb'; diff --git a/src/dashboardWebView/components/Header/Searchbox.tsx b/src/dashboardWebView/components/Header/Searchbox.tsx index d52d9af4..6588f9a8 100644 --- a/src/dashboardWebView/components/Header/Searchbox.tsx +++ b/src/dashboardWebView/components/Header/Searchbox.tsx @@ -1,4 +1,4 @@ -import { FilterIcon, SearchIcon } from '@heroicons/react/solid'; +import SearchIcon from '@heroicons/react/solid/SearchIcon'; import * as React from 'react'; import { useRecoilState } from 'recoil'; import { useDebounce } from '../../../hooks/useDebounce'; diff --git a/src/dashboardWebView/components/Header/ViewSwitch.tsx b/src/dashboardWebView/components/Header/ViewSwitch.tsx index d0e441b3..5409d111 100644 --- a/src/dashboardWebView/components/Header/ViewSwitch.tsx +++ b/src/dashboardWebView/components/Header/ViewSwitch.tsx @@ -1,7 +1,8 @@ import * as React from 'react'; import { useRecoilState, useRecoilValue } from 'recoil'; import { ViewAtom, SettingsSelector } from '../../state'; -import { ViewGridIcon, ViewListIcon } from '@heroicons/react/solid'; +import ViewListIcon from '@heroicons/react/solid/ViewListIcon'; +import ViewGridIcon from '@heroicons/react/solid/ViewGridIcon'; import { Messenger } from '@estruyf/vscode/dist/client'; import { DashboardMessage } from '../../DashboardMessage'; import { DashboardViewType } from '../../models'; diff --git a/src/dashboardWebView/components/Media/FolderCreation.tsx b/src/dashboardWebView/components/Media/FolderCreation.tsx index 5d6cba34..e765a814 100644 --- a/src/dashboardWebView/components/Media/FolderCreation.tsx +++ b/src/dashboardWebView/components/Media/FolderCreation.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { FolderAddIcon } from '@heroicons/react/outline'; +import FolderAddIcon from '@heroicons/react/outline/FolderAddIcon'; import { useRecoilValue } from 'recoil'; import { DashboardMessage } from '../../DashboardMessage'; import { SelectedMediaFolderAtom, SettingsSelector } from '../../state'; diff --git a/src/dashboardWebView/components/Media/FolderItem.tsx b/src/dashboardWebView/components/Media/FolderItem.tsx index 17d9402a..eb416d9d 100644 --- a/src/dashboardWebView/components/Media/FolderItem.tsx +++ b/src/dashboardWebView/components/Media/FolderItem.tsx @@ -1,4 +1,4 @@ -import { FolderIcon } from '@heroicons/react/solid'; +import FolderIcon from '@heroicons/react/solid/FolderIcon'; import { basename } from 'path'; import * as React from 'react'; import { useRecoilState } from 'recoil'; diff --git a/src/dashboardWebView/components/Media/Item.tsx b/src/dashboardWebView/components/Media/Item.tsx index e091ba47..ba6c54b7 100644 --- a/src/dashboardWebView/components/Media/Item.tsx +++ b/src/dashboardWebView/components/Media/Item.tsx @@ -1,6 +1,6 @@ import { Messenger } from '@estruyf/vscode/dist/client'; import { Menu } from '@headlessui/react'; -import { PhotographIcon } from '@heroicons/react/outline'; +import PhotographIcon from '@heroicons/react/outline/PhotographIcon'; import { basename, dirname } from 'path'; import * as React from 'react'; import { useEffect } from 'react'; diff --git a/src/dashboardWebView/components/Media/Media.tsx b/src/dashboardWebView/components/Media/Media.tsx index f4c0d9d0..00fc9c41 100644 --- a/src/dashboardWebView/components/Media/Media.tsx +++ b/src/dashboardWebView/components/Media/Media.tsx @@ -1,6 +1,6 @@ import { Messenger } from '@estruyf/vscode/dist/client'; import { EventData } from '@estruyf/vscode/dist/models'; -import { UploadIcon } from '@heroicons/react/outline'; +import UploadIcon from '@heroicons/react/outline/UploadIcon'; import * as React from 'react'; import { useRecoilState, useRecoilValue } from 'recoil'; import { MediaInfo, MediaPaths } from '../../../models/MediaPaths'; diff --git a/src/dashboardWebView/components/Media/MenuButton.tsx b/src/dashboardWebView/components/Media/MenuButton.tsx index 22279a09..dffee8f6 100644 --- a/src/dashboardWebView/components/Media/MenuButton.tsx +++ b/src/dashboardWebView/components/Media/MenuButton.tsx @@ -1,5 +1,5 @@ import { Menu } from '@headlessui/react'; -import { DotsVerticalIcon } from '@heroicons/react/outline'; +import DotsVerticalIcon from '@heroicons/react/outline/DotsVerticalIcon'; import * as React from 'react'; export interface IMenuButtonProps { diff --git a/src/dashboardWebView/components/Media/Pagination.tsx b/src/dashboardWebView/components/Media/Pagination.tsx index 5f56fc0e..8ed57aeb 100644 --- a/src/dashboardWebView/components/Media/Pagination.tsx +++ b/src/dashboardWebView/components/Media/Pagination.tsx @@ -1,6 +1,6 @@ import { EventData } from '@estruyf/vscode'; import { Messenger } from '@estruyf/vscode/dist/client'; -import { RefreshIcon } from '@heroicons/react/outline'; +import RefreshIcon from '@heroicons/react/outline/RefreshIcon'; import * as React from 'react'; import { useRecoilState, useRecoilValue } from 'recoil'; import { useDebounce } from '../../../hooks/useDebounce'; diff --git a/src/dashboardWebView/components/Menu/MenuButton.tsx b/src/dashboardWebView/components/Menu/MenuButton.tsx index 52aa95d6..439f3eb6 100644 --- a/src/dashboardWebView/components/Menu/MenuButton.tsx +++ b/src/dashboardWebView/components/Menu/MenuButton.tsx @@ -1,5 +1,5 @@ import { Menu } from '@headlessui/react'; -import { ChevronDownIcon } from '@heroicons/react/solid'; +import ChevronDownIcon from '@heroicons/react/solid/ChevronDownIcon'; import * as React from 'react'; export interface IMenuButtonProps { diff --git a/src/dashboardWebView/components/Modals/Alert.tsx b/src/dashboardWebView/components/Modals/Alert.tsx index ecc7fca1..7528ca29 100644 --- a/src/dashboardWebView/components/Modals/Alert.tsx +++ b/src/dashboardWebView/components/Modals/Alert.tsx @@ -1,5 +1,5 @@ import { Dialog, Transition, } from '@headlessui/react'; -import { ExclamationIcon } from '@heroicons/react/outline'; +import ExclamationIcon from '@heroicons/react/outline/ExclamationIcon'; import * as React from 'react'; import { Fragment, useRef } from 'react'; diff --git a/src/dashboardWebView/components/SponsorMsg.tsx b/src/dashboardWebView/components/SponsorMsg.tsx index ef0c3549..b4e0b208 100644 --- a/src/dashboardWebView/components/SponsorMsg.tsx +++ b/src/dashboardWebView/components/SponsorMsg.tsx @@ -1,4 +1,5 @@ -import { HeartIcon, StarIcon } from '@heroicons/react/outline'; +import HeartIcon from '@heroicons/react/outline/HeartIcon'; +import StarIcon from '@heroicons/react/outline/StarIcon'; import * as React from 'react'; import { REVIEW_LINK, SPONSOR_LINK } from '../../constants'; import { VersionInfo } from '../../models'; diff --git a/src/dashboardWebView/components/Steps/Step.tsx b/src/dashboardWebView/components/Steps/Step.tsx index 553f40f3..c877406d 100644 --- a/src/dashboardWebView/components/Steps/Step.tsx +++ b/src/dashboardWebView/components/Steps/Step.tsx @@ -1,4 +1,4 @@ -import { CheckIcon } from '@heroicons/react/outline'; +import CheckIcon from '@heroicons/react/outline/CheckIcon'; import * as React from 'react'; import { Status } from '../../models/Status'; diff --git a/src/dashboardWebView/components/Steps/StepsToGetStarted.tsx b/src/dashboardWebView/components/Steps/StepsToGetStarted.tsx index 0bf44eb9..f7017f4f 100644 --- a/src/dashboardWebView/components/Steps/StepsToGetStarted.tsx +++ b/src/dashboardWebView/components/Steps/StepsToGetStarted.tsx @@ -8,7 +8,7 @@ import { useState } from 'react'; import { Menu } from '@headlessui/react'; import { MenuItem } from '../Menu'; import { Framework } from '../../../models'; -import { ChevronDownIcon } from '@heroicons/react/outline'; +import ChevronDownIcon from '@heroicons/react/outline/ChevronDownIcon'; import { FrameworkDetectors } from '../../../constants/FrameworkDetectors'; export interface IStepsToGetStartedProps { diff --git a/src/dashboardWebView/components/WelcomeScreen.tsx b/src/dashboardWebView/components/WelcomeScreen.tsx index cc0659fa..1405f5fe 100644 --- a/src/dashboardWebView/components/WelcomeScreen.tsx +++ b/src/dashboardWebView/components/WelcomeScreen.tsx @@ -1,4 +1,5 @@ -import { HeartIcon, StarIcon } from '@heroicons/react/outline'; +import HeartIcon from '@heroicons/react/outline/HeartIcon'; +import StarIcon from '@heroicons/react/outline/StarIcon'; import * as React from 'react'; import { GITHUB_LINK, REVIEW_LINK, SPONSOR_LINK } from '../../constants'; import { Messenger } from '@estruyf/vscode/dist/client'; diff --git a/src/panelWebView/components/Fields/ChoiceButton.tsx b/src/panelWebView/components/Fields/ChoiceButton.tsx index aee6cc25..d11039c5 100644 --- a/src/panelWebView/components/Fields/ChoiceButton.tsx +++ b/src/panelWebView/components/Fields/ChoiceButton.tsx @@ -1,4 +1,4 @@ -import { XIcon } from '@heroicons/react/outline'; +import XIcon from '@heroicons/react/outline/XIcon'; import * as React from 'react'; export interface IChoiceButtonProps { diff --git a/src/panelWebView/components/Fields/ChoiceField.tsx b/src/panelWebView/components/Fields/ChoiceField.tsx index 377a86b5..97249e8a 100644 --- a/src/panelWebView/components/Fields/ChoiceField.tsx +++ b/src/panelWebView/components/Fields/ChoiceField.tsx @@ -1,4 +1,5 @@ -import { CheckIcon, ChevronDownIcon } from '@heroicons/react/outline'; +import CheckIcon from '@heroicons/react/outline/CheckIcon'; +import ChevronDownIcon from '@heroicons/react/outline/ChevronDownIcon'; import Downshift from 'downshift'; import * as React from 'react'; import { useEffect } from 'react'; diff --git a/src/panelWebView/components/Fields/DateTimeField.tsx b/src/panelWebView/components/Fields/DateTimeField.tsx index 532adfa7..c322db51 100644 --- a/src/panelWebView/components/Fields/DateTimeField.tsx +++ b/src/panelWebView/components/Fields/DateTimeField.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { VsLabel } from '../VscodeComponents'; -import { ClockIcon } from '@heroicons/react/outline'; +import ClockIcon from '@heroicons/react/outline/ClockIcon'; import DatePicker from 'react-datepicker'; import { forwardRef } from 'react'; import { DateHelper } from '../../../helpers/DateHelper'; diff --git a/src/panelWebView/components/Fields/ImageFallback.tsx b/src/panelWebView/components/Fields/ImageFallback.tsx index 83f45bff..a517a8bc 100644 --- a/src/panelWebView/components/Fields/ImageFallback.tsx +++ b/src/panelWebView/components/Fields/ImageFallback.tsx @@ -1,4 +1,4 @@ -import { XCircleIcon } from '@heroicons/react/solid'; +import XCircleIcon from '@heroicons/react/solid/XCircleIcon'; import * as React from 'react'; export interface IImageFallbackProps { diff --git a/src/panelWebView/components/Fields/NumberField.tsx b/src/panelWebView/components/Fields/NumberField.tsx index 5280626d..da8d3aee 100644 --- a/src/panelWebView/components/Fields/NumberField.tsx +++ b/src/panelWebView/components/Fields/NumberField.tsx @@ -1,4 +1,4 @@ -import { CalculatorIcon } from '@heroicons/react/outline'; +import CalculatorIcon from '@heroicons/react/outline/CalculatorIcon'; import * as React from 'react'; import { useEffect } from 'react'; import { VsLabel } from '../VscodeComponents'; diff --git a/src/panelWebView/components/Fields/PreviewImageField.tsx b/src/panelWebView/components/Fields/PreviewImageField.tsx index d65718f9..73f38691 100644 --- a/src/panelWebView/components/Fields/PreviewImageField.tsx +++ b/src/panelWebView/components/Fields/PreviewImageField.tsx @@ -1,4 +1,4 @@ -import { PhotographIcon } from '@heroicons/react/outline'; +import PhotographIcon from '@heroicons/react/outline/PhotographIcon'; import * as React from 'react'; import { MessageHelper } from '../../../helpers/MessageHelper'; import { CommandToCode } from '../../CommandToCode'; diff --git a/src/panelWebView/components/Fields/TextField.tsx b/src/panelWebView/components/Fields/TextField.tsx index 41623872..98b3ac48 100644 --- a/src/panelWebView/components/Fields/TextField.tsx +++ b/src/panelWebView/components/Fields/TextField.tsx @@ -1,4 +1,4 @@ -import { PencilIcon } from '@heroicons/react/outline'; +import PencilIcon from '@heroicons/react/outline/PencilIcon'; import * as React from 'react'; import { VsLabel } from '../VscodeComponents'; diff --git a/webpack.config.js b/webpack.config.js index a03bd92e..47a93a65 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,6 +3,7 @@ 'use strict'; const path = require('path'); +const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; const config = [ { @@ -34,7 +35,19 @@ const config = [ performance: { maxEntrypointSize: 400000, maxAssetSize: 400000 - } + }, + optimization: { + splitChunks: { + chunks: 'all' + } + }, + plugins: [ + new BundleAnalyzerPlugin({ + analyzerMode: 'static', + reportFilename: "extension.html", + openAnalyzer: false + }) + ] }, { name: 'panelWebView', @@ -66,7 +79,19 @@ const config = [ performance: { maxEntrypointSize: 400000, maxAssetSize: 400000 - } + }, + optimization: { + splitChunks: { + chunks: 'all' + } + }, + plugins: [ + new BundleAnalyzerPlugin({ + analyzerMode: 'static', + reportFilename: "viewpanel.html", + openAnalyzer: false + }) + ] }, { name: 'dashboardWebView', @@ -98,7 +123,19 @@ const config = [ performance: { maxEntrypointSize: 400000, maxAssetSize: 400000 - } + }, + optimization: { + splitChunks: { + chunks: 'all' + } + }, + plugins: [ + new BundleAnalyzerPlugin({ + analyzerMode: 'static', + reportFilename: "dashboard.html", + openAnalyzer: false + }) + ] } ];