We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
NODE_PATH
1 parent 7c9ece2 commit 83d1f58Copy full SHA for 83d1f58
packages/webpack-cli/src/webpack-cli.ts
@@ -156,6 +156,17 @@ class WebpackCLI implements IWebpackCLI {
156
}
157
} while (dir !== (dir = path.dirname(dir)));
158
159
+ // https://github.com/nodejs/node/blob/v18.9.1/lib/internal/modules/cjs/loader.js#L1274
160
+ for (const internalPath of require("module").globalPaths) {
161
+ try {
162
+ if (fs.statSync(path.join(internalPath, packageName)).isDirectory()) {
163
+ return true;
164
+ }
165
+ } catch (_error) {
166
+ // Nothing
167
168
169
+
170
return false;
171
172
0 commit comments