Navigation Menu

Skip to content
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

Allow array as value in externals object #8043

Merged
merged 3 commits into from Sep 18, 2018
Merged

Allow array as value in externals object #8043

merged 3 commits into from Sep 18, 2018

Conversation

RubenVerborgh
Copy link
Contributor

@RubenVerborgh RubenVerborgh commented Sep 17, 2018

Fixes #8041.

#8041 (comment)

What kind of change does this PR introduce?

bugfix (schema)

Did you add tests for your changes?

Yes.

Does this PR introduce a breaking change?

No.

What needs to be documented once your changes are merged?

The documentation is alright; it already mentions this option:
https://webpack.js.org/configuration/externals/#array
(but that doesn't work yet without this PR)

@jsf-clabot
Copy link

jsf-clabot commented Sep 17, 2018

CLA assistant check
All committers have signed the CLA.

@webpack-bot
Copy link
Contributor

For maintainers only:

  • This need to be documented (issue in webpack/webpack.js.org will be filed when merged)

@RubenVerborgh RubenVerborgh changed the title Allow array as value in externals object. Allow array as value in externals object Sep 17, 2018
Copy link
Member

@sokra sokra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a test case: -> test\configCases\externals

@@ -123,6 +123,9 @@
{
"type": "object"
},
{
"type": "array"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be more specific with which items are accepted.

@webpack-bot
Copy link
Contributor

@RubenVerborgh Thanks for your update.

I labeled the Pull Request so reviewers will review it again.

@sokra Please review the new changes.

@RubenVerborgh
Copy link
Contributor Author

@sokra Done.

@@ -0,0 +1,5 @@
module.exports = {
externals: {
external: ["./math", "subtract"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use ["webpack", "version"] and check if the result is a string.

Checking the error doesn't really check if subtract is used or ignored.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copied what is in the other test/configCases/externals/optional-externals-*/webpack.config.js tests. These tests are just testing the configuration, I would expect there to be other tests that actually verify the functionality.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried ["webpack", "version"] and it still errors (test passes without alteration). So if that is supposed to work, there's another issue (which we should then follow up on in #8041 I guess).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you follow the CONTRIBUTION instructions about yarn link && yarn link webpack?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I didn't, as this was originally just a config change 😄
Thanks for the guidance, will fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Followed the instructions, same result. Looks like CI failed due to a random timeout (only AppVeyor failed). Will push commit again.

@webpack-bot
Copy link
Contributor

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@sokra sokra merged commit ab28497 into webpack:master Sep 18, 2018
@sokra
Copy link
Member

sokra commented Sep 18, 2018

Thanks

@sokra
Copy link
Member

sokra commented Sep 18, 2018

btw. your test didn't work, because the Array version wasn't really working internally. It works now.

@RubenVerborgh
Copy link
Contributor Author

@sokra Yeah that's what I figured. Thanks for fixing. Good that you insisted on a functionality test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Example from documentation fails: externals with array as property value
5 participants