-
-
Notifications
You must be signed in to change notification settings - Fork 601
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
fix: improve check for custom webpack-dev-server package existance #3772
Conversation
if ( | ||
dependency === WEBPACK_DEV_SERVER_PACKAGE && | ||
fs.existsSync(WEBPACK_DEV_SERVER_PACKAGE) | ||
) { | ||
skipInstallation = true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, and another good question why we used fs.existsSync
here, can you look at git history?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexander-akait added in this PR #2907
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@snitin315 I think we can remove this check, if developer provided a bad path, node.js itself generate a good error, so I think it is extra unnecessary check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why I was added it 😄
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #3772 +/- ##
==========================================
- Coverage 91.42% 91.39% -0.03%
==========================================
Files 22 22
Lines 1667 1673 +6
Branches 480 484 +4
==========================================
+ Hits 1524 1529 +5
- Misses 143 144 +1
Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, let's add a small test case where we have invalid/unknown path to webpack and/or webpack-dev-server, just ensure we throw an error and it is readable
24f43fd
to
1500796
Compare
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 #3161
Does this PR introduce a breaking change?
No
Other information
No