-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
copy getOptions from webpack #113
Conversation
Codecov Report
@@ Coverage Diff @@
## master #113 +/- ##
==========================================
- Coverage 21.84% 21.03% -0.82%
==========================================
Files 8 8
Lines 467 485 +18
Branches 89 94 +5
==========================================
Hits 102 102
- Misses 322 335 +13
- Partials 43 48 +5
Continue to review full report at Codecov.
|
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.
Ideally we should run webpack api here not copy this, because it can be bad for future webpack changes
I agree, though as of 5.31.2 it's hard to call webpack's getOptions from workers because it's created in NormalModule.prototype.createLoaderContext. Possible options:
|
@alexander-akait here's another attempt: webpack/schema-utils#123. Which do you think is better? |
Seems fine to copy the implementation. I don't think we will change that in webpack any time soon (it would be a breaking change anyway). |
This PR contains a:
Motivation / Use-Case
Attempt to fix #106, a major compatibility problem with Webpack 5.
Breaking Changes
No.
Additional Info
Ideally we should be able to delegate computation to the main process, but unfortunately
getOptions
needs to return a value synchronously. In this PR I just copied the code verbatim. Copyright-wise, it should be sufficient to ask @alexander-akait and @sokra because they seem to be the only authors of the code.