-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
27 lines (26 loc) · 860 Bytes
/
webpack.config.js
File metadata and controls
27 lines (26 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const nodeExternals = require('webpack-node-externals');
/**
* Custom webpack config for NestJS API.
*
* By default, NestJS webpack uses webpack-node-externals which externalizes
* ALL node_modules and workspace packages, emitting bare
* `require("@sherlock/source-linkedin")` calls.
*
* Node.js v24's built-in TypeScript support then resolves those to the raw
* .ts source files via Yarn workspace symlinks and fails because of
* extensionless ESM imports (e.g. `./linkedin.module` without `.js`).
*
* Fix: use a custom allowlist so that @sherlock/* packages are bundled
* (inlined by webpack) rather than externalized.
*/
module.exports = (options) => {
return {
...options,
externals: [
nodeExternals({
// Bundle (inline) all @sherlock/* workspace packages
allowlist: [/^@sherlock\//],
}),
],
};
};