-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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 types: accept a readonly array for configuration options #12818
Conversation
For maintainers only:
|
This is a generated file. Look into lib/webpack.js or lib/index.js and fix it in the jsdocs comments |
274bdf7
to
9273f8d
Compare
Thanks @sokra , I hadn't noticed. I'm now stuck on microsoft/TypeScript#42768 if (Array.isArray(options)) {
/** @type {MultiCompiler} */
compiler = createMultiCompiler(options, options);
watch = options.some(options => options.watch);
watchOptions = options.map(options => options.watchOptions || {});
} else {
/** @type {Compiler} */
compiler = createCompiler(options);
watch = options.watch;
watchOptions = options.watchOptions || {};
} The isArray only guards propery against mutable arrays, not readonly arrays (see the bug in Typescript for deeper details). |
eb78133
to
6438df8
Compare
6438df8
to
60d4605
Compare
Can someone help me with the failing test please? |
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
@pcorpet The most important CI builds failed. This way your PR can't be merged. Please take a look at the CI results from azure (1 errors / 0 warnings) and appveyor (success) and fix these issues. |
The webpack main function can get multiple configuration as an array. However this array doesn't need to be mutable. This fix makes it accept readonly arrays.
What kind of change does this PR introduce?
bugfix for typescript types declaration
Did you add tests for your changes?
No: I couldn't find typing tests.
Does this PR introduce a breaking change?
No: all types that were accepted before are still accepted, it accepts new types.
What needs to be documented once your changes are merged?
Nothing, this is a fix.
This change is