Auto-add names to factory functions in FunctionModuleTemplatePlugin#4858
Auto-add names to factory functions in FunctionModuleTemplatePlugin#4858sophiebits wants to merge 1 commit into
Conversation
I was trying to profile my app's startup in the Chrome devtools. I got this:  Unfortunately, each of the "(anonymous)" blocks is a module factory created by webpack, and it's not easy to tell which is which. This commit adds a slightly mangled version of the path name as that factory function's name, which gives us a profile that is actually useful: 
|
Just putting this up for a discussion; happy to do the work to add/update tests if this seems desirable. cc @gaearon since I bet you'd like this (I was profiling a CRA app) |
|
I like this! Maybe |
|
I wanted to keep in-file separators (ex: the dot before an extension) as well as slashes (as $). If we strip the former then we can make the latter an underscore. |
|
Even switching them might look better actually. I'll try. |
|
There is already a |
I like it. |
|
@spicyj Please review the following output log for errors: See complete report here. |
|
This PR is not needed. You can use the |
I was trying to profile my app's startup in the Chrome devtools. I got this:
Unfortunately, each of the "(anonymous)" blocks is a module factory created by webpack, and it's not easy to tell which is which.
This commit adds a slightly mangled version of the path name as that factory function's name, which gives us a profile that is actually useful:
Much better.
~~
What kind of change does this PR introduce?
minor feature
Did you add tests for your changes?
no
Does this PR introduce a breaking change?
no