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
It would be useful to know which of the modules defined as external were actually required in a build, if any, allowing us to know which modules to package separately.
I've looked at the metafile parameter, but it doesn't seem to contain any information about external modules.
Instead of using external, I could transform the array of module names into a regular expression and use it in a plugin which, for any of those modules, will return external: trueand add the module name to an internal structure.
I was trying to avoid the performance penalty of using a plugin, so I was wondering if you'd consider adding this functionality to the core. If so, I'm happy to work on a PR.
Thanks!
The text was updated successfully, but these errors were encountered:
I think I understand what you’re trying to do. Instead of looking at package.json and marking all known dependencies as external, something I’ve done previously:
It sounds like you want a more programmatic approach by looking at external: true. Do you think a plugin would cause that much overhead here? If I’m not mistaken, V8 highly optimizes regular expressions, so if they’re compiled in advance (which I think they always are), I can’t imagine this would have a large performance footprint.
Btw it looks like metafile was updated recently: (0.9.2)
Previously using metafile with the API is unnecessarily cumbersome because you have to extract the JSON metadata from the output file yourself instead of it just being provided to you as a return value. This is especially a bummer if you are using write: false because then you need to use a for loop over the output files and do string comparisons with the file paths to try to find the one corresponding to the metafile. Returning the metadata directly is an important UX improvement for the API. It means you can now do this:
It would be useful to know which of the modules defined as
external
were actually required in a build, if any, allowing us to know which modules to package separately.I've looked at the
metafile
parameter, but it doesn't seem to contain any information about external modules.Instead of using
external
, I could transform the array of module names into a regular expression and use it in a plugin which, for any of those modules, will returnexternal: true
and add the module name to an internal structure.I was trying to avoid the performance penalty of using a plugin, so I was wondering if you'd consider adding this functionality to the core. If so, I'm happy to work on a PR.
Thanks!
The text was updated successfully, but these errors were encountered: