Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do we need to set externalsPresets when target: 'node'? #116

Open
OliverJAsh opened this issue Oct 11, 2021 · 0 comments
Open

Do we need to set externalsPresets when target: 'node'? #116

OliverJAsh opened this issue Oct 11, 2021 · 0 comments

Comments

@OliverJAsh
Copy link

OliverJAsh commented Oct 11, 2021

Regarding this part of the docs:

**Note**: For Webpack 5, in addition to `target: 'node'` also include the `externalsPreset` object:
```js
// Webpack 5
const nodeExternals = require('webpack-node-externals');
...
module.exports = {
...
target: 'node',
externalsPresets: { node: true }, // in order to ignore built-in modules like path, fs, etc.
externals: [nodeExternals()], // in order to ignore all modules in node_modules folder
...
};

When target: 'node' I suspect the default for externalsPresets will be { node: true }:

https://github.com/webpack/webpack/blob/88978167ea2ee438761179dbbe2e21233dc9d34d/lib/config/defaults.js#L905

Therefore I'm not sure we need to set externalsPresets when target: 'node'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant