├── .nvmrc ├── test ├── dev-server │ ├── .gitignore │ ├── src.js │ └── webpack.config.js ├── src │ ├── a.js │ ├── b.js │ ├── a-clone.js │ └── index.js ├── bundles │ ├── invalidBundle.js │ ├── validBundleWithArrowFunction.js │ ├── validExtraBundleWithModulesAsArray.js │ ├── validExtraBundleWithNamedChunk.js │ ├── validJsonpWithArrayConcatAndEntryPoint.js │ ├── validWebpack4AsyncChunk.modules.json │ ├── validBundleWithArrowFunction.modules.json │ ├── validExtraBundleWithNamedChunk.modules.json │ ├── validWebpack4AsyncChunk.js │ ├── validWebpack4AsyncChunkWithWebWorkerChunkTemplatePlugin.js │ ├── validWebpack4AsyncChunkAndEntryPoint.modules.json │ ├── validWebpack4AsyncChunkUsingSelfInsteadOfWindow.js │ ├── validWebpack4AsyncChunkUsingThisInsteadOfWindow.js │ ├── validExtraBundleWithModulesAsArray.modules.json │ ├── validWebpack4AsyncChunkUsingCustomGlobalObject.modules.json │ ├── validWebpack4AsyncChunkUsingSelfInsteadOfWindow.modules.json │ ├── validWebpack4AsyncChunkUsingThisInsteadOfWindow.modules.json │ ├── validWebpack4AsyncChunkWithOptimizedModulesArray.modules.json │ ├── validWebpack4AsyncChunkWithWebWorkerChunkTemplatePlugin.modules.json │ ├── validJsonpWithArrayConcatAndEntryPoint.modules.json │ ├── validWebpack4AsyncChunkAndEntryPoint.js │ ├── validWebpack4AsyncChunkWithOptimizedModulesArray.js │ ├── validWebpack5ModernBundle.modules.json │ ├── validWebpack5LegacyBundle.modules.json │ ├── validNodeBundle.js │ ├── validWebpack4AsyncChunkUsingCustomGlobalObject.js │ ├── validWebpack5ModernBundle.js │ ├── validCommonBundleWithDedupePlugin.modules.json │ ├── validNodeBundle.modules.json │ ├── validCommonBundleWithModulesAsArray.modules.json │ ├── validUmdLibraryBundleWithModulesAsArray.modules.json │ ├── validWebpack5LegacyBundle.js │ ├── validCommonBundleWithModulesAsObject.modules.json │ ├── validBundleWithEsNextFeatures.modules.json │ ├── validExtraBundleWithModulesInsideArrayConcat.js │ ├── validExtraBundleWithModulesInsideArrayConcat.modules.json │ ├── validBundleWithEsNextFeatures.js │ ├── validUmdLibraryBundleWithModulesAsArray.js │ ├── validCommonBundleWithDedupePlugin.js │ ├── validCommonBundleWithModulesAsArray.js │ └── validCommonBundleWithModulesAsObject.js ├── stats │ ├── with-invalid-chunk │ │ ├── invalid-chunk.js │ │ └── valid-chunk.js │ ├── extremely-optimized-webpack-5-bundle │ │ ├── bundle.js │ │ └── expected-chart-data.js │ ├── webpack-5-bundle-with-concatenated-entry-module │ │ ├── app.js │ │ └── expected-chart-data.json │ ├── with-worker-loader-dynamic-import │ │ ├── 1.bundle.worker.js │ │ ├── 1.bundle.js │ │ ├── bundle.js │ │ └── bundle.worker.js │ ├── with-non-asset-asset │ │ └── bundle.js │ ├── webpack-5-bundle-with-single-entry │ │ ├── bundle.js │ │ └── expected-chart-data.js │ ├── with-special-chars │ │ ├── expected-chart-data.js │ │ ├── bundle.js │ │ └── stats.json │ ├── webpack-5-bundle-with-multiple-entries │ │ ├── bundle.js │ │ └── expected-chart-data.js │ ├── with-missing-chunk │ │ └── valid-chunk.js │ ├── with-missing-module-chunks │ │ └── valid-chunk.js │ ├── with-module-concatenation-info │ │ ├── bundle.js │ │ └── expected-chart-data.js │ ├── with-array-config │ │ ├── config-1-main.js │ │ └── config-2-main.js │ ├── with-worker-loader │ │ └── bundle.js │ ├── with-modules-in-chunks │ │ └── expected-chart-data.js │ ├── with-no-entrypoints │ │ └── stats.json │ ├── minimal-stats │ │ └── stats.json │ ├── with-invalid-dynamic-require.json │ └── with-missing-parsed-module │ │ └── bundle.js ├── .gitignore ├── webpack-versions │ ├── 4.44.2 │ │ └── package.json │ └── 5.76.0 │ │ └── package.json ├── .eslintrc.json ├── dev-server.js ├── parseUtils.js ├── utils.js ├── statsUtils.js ├── Logger.js ├── viewer.js └── helpers.js ├── .eslintrc.json ├── .gitignore ├── client ├── components │ ├── ModulesList.css │ ├── Icon.css │ ├── Switcher.css │ ├── CheckboxList.css │ ├── Checkbox.css │ ├── ContextMenuItem.css │ ├── Tooltip.css │ ├── ContextMenu.css │ ├── SwitcherItem.jsx │ ├── ContextMenuItem.jsx │ ├── ThemeToggle.css │ ├── Dropdown.css │ ├── Button.css │ ├── Checkbox.jsx │ ├── Search.css │ ├── ThemeToggle.jsx │ ├── ModuleItem.css │ ├── Switcher.jsx │ ├── ModulesList.jsx │ ├── CheckboxListItem.jsx │ ├── ModulesTreemap.css │ ├── Button.jsx │ ├── Icon.jsx │ ├── Sidebar.css │ ├── Tooltip.jsx │ ├── Search.jsx │ ├── Dropdown.jsx │ ├── ModuleItem.jsx │ ├── CheckboxList.jsx │ ├── ContextMenu.jsx │ ├── Sidebar.jsx │ └── Treemap.jsx ├── assets │ ├── icon-moon.svg │ ├── icon-arrow-right.svg │ ├── icon-sun.svg │ ├── icon-folder.svg │ ├── icon-module.svg │ ├── icon-invisible.svg │ ├── icon-chunk.svg │ └── icon-pin.svg ├── .eslintrc.json ├── utils.js ├── lib │ └── PureComponent.jsx ├── localStorage.js ├── viewer.jsx ├── viewer.css └── store.js ├── .browserslistrc ├── bin └── install-test-webpack-versions.sh ├── src ├── index.js ├── sizeUtils.js ├── tree │ ├── Node.js │ ├── utils.js │ ├── ContentModule.js │ ├── ContentFolder.js │ ├── Module.js │ ├── Folder.js │ ├── ConcatenatedModule.js │ └── BaseFolder.js ├── Logger.js ├── utils.js ├── statsUtils.js ├── template.js ├── BundleAnalyzerPlugin.js ├── bin │ └── analyzer.js └── viewer.js ├── .babelrc ├── .editorconfig ├── .eslintignore ├── .npm-upgrade.json ├── jest.config.js ├── LICENSE ├── .github └── workflows │ └── main.yml ├── gulpfile.js ├── CONTRIBUTING.md ├── package.json └── webpack.config.js /.nvmrc: -------------------------------------------------------------------------------- 1 | v22.14.0 2 | -------------------------------------------------------------------------------- /test/dev-server/.gitignore: -------------------------------------------------------------------------------- 1 | output 2 | -------------------------------------------------------------------------------- /test/src/a.js: -------------------------------------------------------------------------------- 1 | module.exports = 'module a'; 2 | -------------------------------------------------------------------------------- /test/src/b.js: -------------------------------------------------------------------------------- 1 | module.exports = 'module b'; 2 | -------------------------------------------------------------------------------- /test/src/a-clone.js: -------------------------------------------------------------------------------- 1 | module.exports = 'module a'; 2 | -------------------------------------------------------------------------------- /test/dev-server/src.js: -------------------------------------------------------------------------------- 1 | export const chuck = 'norris'; 2 | -------------------------------------------------------------------------------- /test/bundles/invalidBundle.js: -------------------------------------------------------------------------------- 1 | module.exports = 'invalid bundle'; 2 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "extends": "th0r" 4 | } 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /lib 2 | /public 3 | /samples 4 | node_modules 5 | npm-debug.log 6 | -------------------------------------------------------------------------------- /test/src/index.js: -------------------------------------------------------------------------------- 1 | require('./a'); 2 | require('./b'); 3 | require('./a-clone'); 4 | -------------------------------------------------------------------------------- /test/stats/with-invalid-chunk/invalid-chunk.js: -------------------------------------------------------------------------------- 1 | console.log('invalid chunk'); 2 | -------------------------------------------------------------------------------- /client/components/ModulesList.css: -------------------------------------------------------------------------------- 1 | .container { 2 | font: var(--main-font); 3 | } 4 | -------------------------------------------------------------------------------- /test/.gitignore: -------------------------------------------------------------------------------- 1 | output 2 | 3 | # Sandbox config 4 | /webpack.config.js 5 | # Output of sandbox config 6 | /dist 7 | -------------------------------------------------------------------------------- /test/stats/extremely-optimized-webpack-5-bundle/bundle.js: -------------------------------------------------------------------------------- 1 | (()=>{"use strict";console.log("module a","module b")})(); -------------------------------------------------------------------------------- /test/bundles/validBundleWithArrowFunction.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([0],[(t,e,r)=>{ 2 | console.log("Hello world!"); 3 | }]); 4 | -------------------------------------------------------------------------------- /test/bundles/validExtraBundleWithModulesAsArray.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([0,2],[,,function(t,e,r){'123'},,,function(t,e){'12345'},]); 2 | -------------------------------------------------------------------------------- /test/bundles/validExtraBundleWithNamedChunk.js: -------------------------------------------------------------------------------- 1 | webpackJsonp(["app"],{125:function(n,e,t){console.log("it works");}},[125]); 2 | -------------------------------------------------------------------------------- /test/webpack-versions/4.44.2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "dependencies": { 4 | "webpack": "4.44.2" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/webpack-versions/5.76.0/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "dependencies": { 4 | "webpack": "5.76.0" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.browserslistrc: -------------------------------------------------------------------------------- 1 | # Supported browsers 2 | 3 | last 2 Chrome major versions 4 | last 2 Firefox major versions 5 | last 1 Safari major version 6 | -------------------------------------------------------------------------------- /test/bundles/validJsonpWithArrayConcatAndEntryPoint.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([10],Array(10).concat([function(e,t,n){'abcd'},,,,function(e,t,n){'efgh'}]),[11]); -------------------------------------------------------------------------------- /test/bundles/validWebpack4AsyncChunk.modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": { 3 | "57iH": "function(e,n,t){console.log(\"hello world\")}" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /bin/install-test-webpack-versions.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | for dir in "$(dirname "$0")"/../test/webpack-versions/*; do (cd "$dir" && npm i); done 4 | -------------------------------------------------------------------------------- /test/bundles/validBundleWithArrowFunction.modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": { 3 | "0": "(t,e,r)=>{\n console.log(\"Hello world!\");\n}" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/bundles/validExtraBundleWithNamedChunk.modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": { 3 | "125": "function(n,e,t){console.log(\"it works\");}" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/bundles/validWebpack4AsyncChunk.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[27],{"57iH":function(e,n,t){console.log("hello world")}}]); 2 | -------------------------------------------------------------------------------- /test/bundles/validWebpack4AsyncChunkWithWebWorkerChunkTemplatePlugin.js: -------------------------------------------------------------------------------- 1 | self.chunkCallbackName([27],{1:function(e,n,t){console.log("Chuck Norris")}}); 2 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | const {start} = require('./viewer'); 2 | 3 | module.exports = { 4 | start, 5 | BundleAnalyzerPlugin: require('./BundleAnalyzerPlugin') 6 | }; 7 | -------------------------------------------------------------------------------- /test/stats/webpack-5-bundle-with-concatenated-entry-module/app.js: -------------------------------------------------------------------------------- 1 | (()=>{"use strict";console.log("foo.js"),console.log("bar.js")})(),console.log("baz.js"); 2 | -------------------------------------------------------------------------------- /test/bundles/validWebpack4AsyncChunkAndEntryPoint.modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": { 3 | "57iH": "function(e,n,t){console.log(\"hello world\")}" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/bundles/validWebpack4AsyncChunkUsingSelfInsteadOfWindow.js: -------------------------------------------------------------------------------- 1 | (self.webpackJsonp=self.webpackJsonp||[]).push([[27],{1:function(e,n,t){console.log("Chuck Norris")}}]); 2 | -------------------------------------------------------------------------------- /test/bundles/validWebpack4AsyncChunkUsingThisInsteadOfWindow.js: -------------------------------------------------------------------------------- 1 | (this.webpackJsonp=this.webpackJsonp||[]).push([[27],{1:function(e,n,t){console.log("Chuck Norris")}}]); 2 | -------------------------------------------------------------------------------- /test/stats/with-worker-loader-dynamic-import/1.bundle.worker.js: -------------------------------------------------------------------------------- 1 | self.webpackChunk([1],[,function(n,t,c){"use strict";c.r(t),c.d(t,"foo",(function(){return o}));const o=42}]); -------------------------------------------------------------------------------- /test/bundles/validExtraBundleWithModulesAsArray.modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": { 3 | "2": "function(t,e,r){'123'}", 4 | "5": "function(t,e){'12345'}" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/bundles/validWebpack4AsyncChunkUsingCustomGlobalObject.modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": { 3 | "1": "function(e,n,t){console.log(\"Chuck Norris\")}" 4 | } 5 | } 6 | 7 | -------------------------------------------------------------------------------- /test/bundles/validWebpack4AsyncChunkUsingSelfInsteadOfWindow.modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": { 3 | "1": "function(e,n,t){console.log(\"Chuck Norris\")}" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/bundles/validWebpack4AsyncChunkUsingThisInsteadOfWindow.modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": { 3 | "1": "function(e,n,t){console.log(\"Chuck Norris\")}" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/bundles/validWebpack4AsyncChunkWithOptimizedModulesArray.modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": { 3 | "549": "function(e,n,t){console.log(\"hello world\")}" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/bundles/validWebpack4AsyncChunkWithWebWorkerChunkTemplatePlugin.modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": { 3 | "1": "function(e,n,t){console.log(\"Chuck Norris\")}" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/bundles/validJsonpWithArrayConcatAndEntryPoint.modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": { 3 | "10": "function(e,t,n){'abcd'}", 4 | "14": "function(e,t,n){'efgh'}" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /client/assets/icon-moon.svg: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /test/bundles/validWebpack4AsyncChunkAndEntryPoint.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[27],{"57iH":function(e,n,t){console.log("hello world")}},[["57iH",19,24,25]]]); 2 | -------------------------------------------------------------------------------- /test/bundles/validWebpack4AsyncChunkWithOptimizedModulesArray.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([['chunkId1', 'chunkId2'],Array(549).concat([function(e,n,t){console.log("hello world")}])]); 2 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | // Babel config for Node 2 | // Compiles sources, gulpfile and tests 3 | { 4 | "presets": [ 5 | ["@babel/preset-env", { 6 | "targets": {"node": "16.20.2"} 7 | }] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /test/stats/with-worker-loader-dynamic-import/1.bundle.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[1],[,function(n,e,o){"use strict";o.r(e),e.default=function(){return new Worker(o.p+"bundle.worker.js")}}]]); -------------------------------------------------------------------------------- /client/components/Icon.css: -------------------------------------------------------------------------------- 1 | .icon { 2 | background: no-repeat center/contain; 3 | display: inline-block; 4 | filter: invert(0); 5 | } 6 | 7 | [data-theme="dark"] .icon { 8 | filter: invert(1); 9 | } 10 | -------------------------------------------------------------------------------- /test/bundles/validWebpack5ModernBundle.modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": { 3 | "631": "r=>{r.exports=\"module a\"}", 4 | "85": "r=>{r.exports=\"module a\"}", 5 | "326": "r=>{r.exports=\"module b\"}" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/bundles/validWebpack5LegacyBundle.modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": { 3 | "631": "function(o){o.exports=\"module a\"}", 4 | "85": "function(o){o.exports=\"module a\"}", 5 | "326": "function(o){o.exports=\"module b\"}" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /client/assets/icon-arrow-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | 6 | indent_style = space 7 | indent_size = 2 8 | 9 | end_of_line = lf 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | 13 | [*.md] 14 | trim_trailing_whitespace = false 15 | -------------------------------------------------------------------------------- /client/components/Switcher.css: -------------------------------------------------------------------------------- 1 | .container { 2 | font: var(--main-font); 3 | white-space: nowrap; 4 | } 5 | 6 | .label { 7 | font-weight: bold; 8 | font-size: 11px; 9 | margin-bottom: 7px; 10 | } 11 | 12 | .item + .item { 13 | margin-left: 5px; 14 | } 15 | -------------------------------------------------------------------------------- /test/stats/with-non-asset-asset/bundle.js: -------------------------------------------------------------------------------- 1 | (()=>{var r={146:r=>{r.exports="module a"},296:r=>{r.exports="module a"},260:r=>{r.exports="module b"}},e={};function o(t){if(e[t])return e[t].exports;var p=e[t]={exports:{}};return r[t](p,p.exports,o),p.exports}o(296),o(260),o(146)})(); -------------------------------------------------------------------------------- /client/components/CheckboxList.css: -------------------------------------------------------------------------------- 1 | .container { 2 | font: var(--main-font); 3 | white-space: nowrap; 4 | } 5 | 6 | .label { 7 | font-size: 11px; 8 | font-weight: bold; 9 | margin-bottom: 7px; 10 | } 11 | 12 | .item + .item { 13 | margin-top: 1px; 14 | } 15 | -------------------------------------------------------------------------------- /test/bundles/validNodeBundle.js: -------------------------------------------------------------------------------- 1 | exports.ids = ["common"]; 2 | exports.modules = { 3 | 0: function(e,t,n){n(1),n(21),n(96),n(306),n(23),n(150),n(57),n(56),n(34),n(138),e.exports=n(348)}, 4 | 3: function(e,t,n){"use strict";e.exports=n(680)}, 5 | 5: function(e,t){} 6 | }; 7 | -------------------------------------------------------------------------------- /test/bundles/validWebpack4AsyncChunkUsingCustomGlobalObject.js: -------------------------------------------------------------------------------- 1 | (("undefined" != typeof self ? self : this).webpackJsonp_someCustomName = ("undefined" != typeof self ? self : this).webpackJsonp_someCustomName || []).push([[27],{1:function(e,n,t){console.log("Chuck Norris")}}]); 2 | -------------------------------------------------------------------------------- /test/bundles/validWebpack5ModernBundle.js: -------------------------------------------------------------------------------- 1 | (()=>{var r={631:r=>{r.exports="module a"},85:r=>{r.exports="module a"},326:r=>{r.exports="module b"}},e={};function o(t){if(e[t])return e[t].exports;var p=e[t]={exports:{}};return r[t](p,p.exports,o),p.exports}o(85),o(326),o(631)})(); 2 | -------------------------------------------------------------------------------- /test/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../.eslintrc.json", 3 | "env": { 4 | "jest": true, 5 | "browser": true 6 | }, 7 | "globals": { 8 | "makeWebpackConfig": true, 9 | "webpackCompile": true, 10 | "forEachWebpackVersion": true 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/bundles/validCommonBundleWithDedupePlugin.modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": { 3 | "0": "function(t,r,e){e(1),e(2)}", 4 | "1": "function(t,r){t.exports=1}", 5 | "2": "1", 6 | "4": "[2, 'arg1', 'arg2']", 7 | "6": "['module-id', 'arg']" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/bundles/validNodeBundle.modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": { 3 | "0": "function(e,t,n){n(1),n(21),n(96),n(306),n(23),n(150),n(57),n(56),n(34),n(138),e.exports=n(348)}", 4 | "3": "function(e,t,n){\"use strict\";e.exports=n(680)}", 5 | "5": "function(e,t){}" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /client/assets/icon-sun.svg: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /client/components/Checkbox.css: -------------------------------------------------------------------------------- 1 | .label { 2 | cursor: pointer; 3 | display: inline-block; 4 | } 5 | 6 | .checkbox { 7 | cursor: pointer; 8 | } 9 | 10 | .itemText { 11 | margin-left: 3px; 12 | position: relative; 13 | top: -2px; 14 | vertical-align: middle; 15 | } 16 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | # Node modules 2 | node_modules 3 | 4 | # Generated code 5 | lib 6 | public 7 | 8 | # Test fixtures 9 | test/bundles 10 | test/stats 11 | test/webpack.config.js 12 | 13 | # Test results 14 | test/output 15 | 16 | # Webpack config 17 | webpack.config.js 18 | 19 | samples 20 | -------------------------------------------------------------------------------- /test/bundles/validCommonBundleWithModulesAsArray.modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": { 3 | "0": "function(e,t,n){n(1),n(21),n(96),n(306),n(23),n(150),n(57),n(56),n(34),n(138),e.exports=n(348)}", 4 | "3": "function(e,t,n){\"use strict\";e.exports=n(680)}", 5 | "5": "function(e,t){}" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/stats/webpack-5-bundle-with-single-entry/bundle.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var o,t,n={85:function(o,t){t.Z="module a"},326:function(o,t){t.Z="module b"}},r={};function e(o){if(r[o])return r[o].exports;var t=r[o]={exports:{}};return n[o](t,t.exports,e),t.exports}o=e(85),t=e(326),console.log(o.Z,t.Z)}(); -------------------------------------------------------------------------------- /test/bundles/validUmdLibraryBundleWithModulesAsArray.modules.json: -------------------------------------------------------------------------------- 1 | { 2 | "modules": { 3 | "0": "function(e,o,t){t(1),t(2),t(3)}", 4 | "1": "function(e,o){e.exports=\"module a\"}", 5 | "2": "function(e,o){e.exports=\"module b\"}", 6 | "3": "function(e,o){e.exports=\"module a\"}" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/bundles/validWebpack5LegacyBundle.js: -------------------------------------------------------------------------------- 1 | !function(){var o={631:function(o){o.exports="module a"},85:function(o){o.exports="module a"},326:function(o){o.exports="module b"}},t={};function r(e){if(t[e])return t[e].exports;var n=t[e]={exports:{}};return o[e](n,n.exports,r),n.exports}r(85),r(326),r(631)}(); 2 | -------------------------------------------------------------------------------- /test/stats/with-special-chars/expected-chart-data.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | { 3 | "groups": [ 4 | { 5 | "id": 0, 6 | "label": "index.js", 7 | "path": "./index.js", 8 | "statSize": 1021 9 | } 10 | ], 11 | "label": "bundle.js", 12 | "statSize": 1021 13 | } 14 | ]; 15 | -------------------------------------------------------------------------------- /client/components/ContextMenuItem.css: -------------------------------------------------------------------------------- 1 | .item { 2 | cursor: pointer; 3 | margin: 0; 4 | padding: 8px 14px; 5 | user-select: none; 6 | } 7 | 8 | .item:hover { 9 | background: #ffefd7; 10 | } 11 | 12 | .disabled { 13 | cursor: default; 14 | color: gray; 15 | } 16 | 17 | .item.disabled:hover { 18 | background: transparent; 19 | } 20 | -------------------------------------------------------------------------------- /client/assets/icon-folder.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/sizeUtils.js: -------------------------------------------------------------------------------- 1 | const zlib = require('zlib'); 2 | 3 | export function getCompressedSize(compressionAlgorithm, input) { 4 | if (compressionAlgorithm === 'gzip') return zlib.gzipSync(input, {level: 9}).length; 5 | if (compressionAlgorithm === 'brotli') return zlib.brotliCompressSync(input).length; 6 | 7 | throw new Error(`Unsupported compression algorithm: ${compressionAlgorithm}.`); 8 | } 9 | -------------------------------------------------------------------------------- /.npm-upgrade.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignore": { 3 | "mobx": { 4 | "versions": ">=6", 5 | "reason": "v6 drops decorators" 6 | }, 7 | "mobx-react": { 8 | "versions": ">=7", 9 | "reason": "v7 requires MobX v6" 10 | }, 11 | "webpack-cli": { 12 | "versions": ">=4", 13 | "reason": "Current version of Webpack Dev Server doesn't work with v4" 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /client/components/Tooltip.css: -------------------------------------------------------------------------------- 1 | .container { 2 | font: var(--main-font); 3 | position: absolute; 4 | padding: 5px 10px; 5 | border-radius: 4px; 6 | background: #fff; 7 | border: 1px solid #aaa; 8 | opacity: 0.9; 9 | white-space: nowrap; 10 | visibility: visible; 11 | transition: opacity .2s ease, visibility .2s ease; 12 | } 13 | 14 | .hidden { 15 | opacity: 0; 16 | visibility: hidden; 17 | } 18 | -------------------------------------------------------------------------------- /client/components/ContextMenu.css: -------------------------------------------------------------------------------- 1 | .container { 2 | font: var(--main-font); 3 | position: absolute; 4 | padding: 0; 5 | border-radius: 4px; 6 | background: #fff; 7 | border: 1px solid #aaa; 8 | list-style: none; 9 | opacity: 1; 10 | white-space: nowrap; 11 | visibility: visible; 12 | transition: opacity .2s ease, visibility .2s ease; 13 | } 14 | 15 | .hidden { 16 | opacity: 0; 17 | visibility: hidden; 18 | } 19 | -------------------------------------------------------------------------------- /client/assets/icon-module.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /client/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "th0r-react", 4 | "../.eslintrc.json" 5 | ], 6 | "settings": { 7 | "react": { 8 | "version": "16.2" 9 | } 10 | }, 11 | "parserOptions": { 12 | "ecmaFeatures": { 13 | "legacyDecorators": true 14 | } 15 | }, 16 | "rules": { 17 | "react/jsx-key": "off", 18 | "react/jsx-no-bind": "off", 19 | "react/react-in-jsx-scope": "off" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /client/components/SwitcherItem.jsx: -------------------------------------------------------------------------------- 1 | import Button from './Button'; 2 | import PureComponent from '../lib/PureComponent'; 3 | 4 | export default class SwitcherItem extends PureComponent { 5 | render({item, ...props}) { 6 | return ( 7 | 10 | ); 11 | } 12 | 13 | handleClick = () => { 14 | this.props.onClick(this.props.item); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/tree/Node.js: -------------------------------------------------------------------------------- 1 | export default class Node { 2 | 3 | constructor(name, parent) { 4 | this.name = name; 5 | this.parent = parent; 6 | } 7 | 8 | get path() { 9 | const path = []; 10 | let node = this; 11 | 12 | while (node) { 13 | path.push(node.name); 14 | node = node.parent; 15 | } 16 | 17 | return path.reverse().join('/'); 18 | } 19 | 20 | get isRoot() { 21 | return !this.parent; 22 | } 23 | 24 | }; 25 | -------------------------------------------------------------------------------- /client/components/ContextMenuItem.jsx: -------------------------------------------------------------------------------- 1 | import cls from 'classnames'; 2 | import s from './ContextMenuItem.css'; 3 | 4 | function noop() { 5 | return false; 6 | } 7 | 8 | export default function ContextMenuItem({children, disabled, onClick}) { 9 | const className = cls({ 10 | [s.item]: true, 11 | [s.disabled]: disabled 12 | }); 13 | const handler = disabled ? noop : onClick; 14 | return (