Closed david-fong closed 3 years ago
@david-fong thanks for this suggestion. Actually the externalsPresets: { node: true }
setting will only externalize the built in packages of node, and not the installed mode modules themselves.
If you'll look at the official Webpack documentation you can actually see that this plug-in is still the recommended way for externalizing node modules.
The externalsPresets
key only replaces the target
key in the config in that sense, and not the entire externals mechanism.
Thanks again for the suggestion.
(This is just a suggestion).
WebPack v5 has added a new option called
externalsPresets
. The"node"
setting is probably what most people will want to use for code that will only run on the NodeJS runtime. For people who are new to WebPack and who find this package, it may be helpful to them to mention that they don't need this plugin for such a use-case.