You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@th0r yes, this is correct behavior. in your case the directory is empty, otherwise all files inside directory are present in found modules, because files paths include directory name
@th0r oh, my fault( so we should check for this.searchQueryRegexp and if someone is looking for a directory then we should consider directory size, otherwise no 😏I can submit a pull request.
I don't think it will work either. The proper solution would be to check nesting of the found items e.g. if we have found "lodash/find.js" module then we should ignore it's size if we also found a whole "lodash" directory. So this task is not so simple and may require quite significant changes in the data structure that currently represents modules tree.
@kyriiherman(lodash$)|(react) is a valid RegExp that will match both lodash folder and all the react folders and modules. core\.js$ can match both core.js folder and core.js module. RegExp can't tell you what user is looking for.
@th0r so we need to filter modules tree in foundModulesByChunk, but save its structure and then in foundModules use walkModules to convert modules tree into collection. with this approach we can use tree structure to count totalSize
Activity
valscion commentedon Feb 14, 2019
Hmm are you sure your lodash in
5.chunk.jsisn't that large? Does it show a different size in the treeview?th0r commentedon Feb 14, 2019
I think its a legit bug. I've overlooked this case.
kyriiherman commentedon Feb 14, 2019
@th0r @valscion I think bug is here https://github.com/webpack-contrib/webpack-bundle-analyzer/blob/d7682a655abda824c82b9d6bb7991b9576c33610/client/store.js#L153. You should check for
!module.groupsbefore adding module sizeth0r commentedon Feb 14, 2019
@kyriiherman it's not so easy. What if the only found item is a directory? In your case the size will be zero.
kyriiherman commentedon Feb 14, 2019
@th0r yes, this is correct behavior. in your case the directory is empty, otherwise all files inside directory are present in found modules, because files paths include directory name
th0r commentedon Feb 14, 2019
@kyriiherman No, it's not. You can input a regexp that will match only directory name e.g.
node_modules$and it won't be empty.kyriiherman commentedon Feb 14, 2019
@th0r oh, my fault( so we should check for
this.searchQueryRegexpand if someone is looking for a directory then we should consider directory size, otherwise no 😏I can submit a pull request.th0r commentedon Feb 14, 2019
I don't think it will work either. The proper solution would be to check nesting of the found items e.g. if we have found "lodash/find.js" module then we should ignore it's size if we also found a whole "lodash" directory. So this task is not so simple and may require quite significant changes in the data structure that currently represents modules tree.
kyriiherman commentedon Feb 15, 2019
@th0r why you think solution with checking
this.searchQueryRegexpisn't ok?th0r commentedon Feb 15, 2019
@kyriiherman
(lodash$)|(react)is a valid RegExp that will match bothlodashfolder and all the react folders and modules.core\.js$can match bothcore.jsfolder andcore.jsmodule. RegExp can't tell you what user is looking for.kyriiherman commentedon Feb 15, 2019
@th0r so we need to filter modules tree in
foundModulesByChunk, but save its structure and then infoundModulesusewalkModulesto convert modules tree into collection. with this approach we can use tree structure to counttotalSizeanatoliyarkhipov commentedon Oct 25, 2019
Just to clarify, the problem is still here, right? If yes, what do you think about this regexp, do I get the real number this way? 🤔

valscion commentedon Oct 25, 2019
Yes the problem is still there. I don't know the answer to your other question, maybe someone else knows.
ppJuan commentedon Jan 12, 2021
same problem

fix: don't count modules inside found directories twice in search total
fix: don't count modules inside found directories twice in search total
fix: don't count modules inside found directories twice in search tot…