fix: respect `NODE_PATH` env variable
What kind of change does this PR introduce? bugfix
Did you add tests for your changes? No.
If relevant, did you update the documentation? No.
Summary
Fix https://github.com/webpack/webpack-cli/issues/3355
Does this PR introduce a breaking change? No.
Other information No
Codecov Report
Merging #3411 (080c6cc) into next (ee91c94) will decrease coverage by
3.16%. The diff coverage is91.45%.
Additional details and impacted files
@@ Coverage Diff @@
## next #3411 +/- ##
==========================================
- Coverage 94.91% 91.74% -3.17%
==========================================
Files 30 22 -8
Lines 1690 1587 -103
Branches 492 447 -45
==========================================
- Hits 1604 1456 -148
- Misses 86 131 +45
| Impacted Files | Coverage Δ | |
|---|---|---|
| packages/generators/src/handlers/react.ts | 56.81% <56.81%> (ø) |
|
| packages/webpack-cli/bin/cli.js | 85.71% <66.66%> (+19.04%) |
:arrow_up: |
| packages/serve/src/index.ts | 78.94% <78.76%> (-5.33%) |
:arrow_down: |
| ...ges/webpack-cli/src/utils/dynamic-import-loader.ts | 83.33% <83.33%> (ø) |
|
| packages/generators/src/index.ts | 86.36% <83.78%> (-13.64%) |
:arrow_down: |
| packages/generators/src/loader-generator.ts | 91.66% <85.71%> (ø) |
|
| packages/generators/src/init-generator.ts | 85.29% <86.20%> (-12.67%) |
:arrow_down: |
| packages/generators/src/addon-generator.ts | 92.98% <91.30%> (+0.38%) |
:arrow_up: |
| packages/webpack-cli/src/webpack-cli.ts | 93.38% <93.38%> (ø) |
|
| packages/generators/src/utils/helpers.ts | 95.00% <93.75%> (+10.00%) |
:arrow_up: |
| ... and 15 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 1524ec2...080c6cc. Read the comment docs.
@snitin315 Thanks for your update.
I labeled the Pull Request so reviewers will review it again.
@alexander-akait Please review the new changes.
Rebased.
Something wrong on CI, debugging.
Weird
TypeError: Cannot read properties of undefined (reading 'cli') at WebpackCLI.getBuiltInOptions (D:\a\webpack-cli\webpack-cli\packages\webpack-cli\lib\webpack-cli.js:25743:60) at outputHelp (D:\a\webpack-cli\webpack-cli\packages\webpack-cli\lib\webpack-cli.js:27213:43) at Command.
(D:\a\webpack-cli\webpack-cli\packages\webpack-cli\lib\webpack-cli.js:27467:9) at async Promise.all (index 63) at WebpackCLI.run (D:\a\webpack-cli\webpack-cli\packages\webpack-cli\lib\webpack-cli.js:27595:5)
@alexander-akait fixed, I moved the check outside of the loop.
And let's add the check if (process.env.NODE_PATH) {}
@snitin315 Can you send the same PR for webpack itself too?