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

Correct ExternalModule's global option (#6933) #7038

Merged

Conversation

marcusdarmstrong
Copy link
Contributor

What kind of change does this PR introduce?

Quick fix for #6933.

Did you add tests for your changes?

No, as there weren't any covering this code to begin with.

If relevant, link to documentation update:

Summary

Currently ExternalModules that have a type of 'global' produce invalid code, as described in #6933. This affects things like the DllPlugin.

Does this PR introduce a breaking change?

No.

Other information

@jsf-clabot
Copy link

jsf-clabot commented Apr 13, 2018

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

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:

In test/configCases

Set externals: { ext: "global external" } in config

Set the global var just before require("ext").

Delete it afterwards to not leak.

@webpack-bot
Copy link
Contributor

webpack-bot commented May 16, 2018

For maintainers only:

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

@TheLarkInn
Copy link
Member

@marcusdarmstrong Let me know if you need further help with any of the comments we've provided. No time pressure, just making sure instructions are clear!

@marcusdarmstrong
Copy link
Contributor Author

@TheLarkInn haven’t had a chance to look yet, but I don’t expect difficulty. We’ve been running with this hacked in via the prototype so it’s been lower priority to get it upstreamed, but still on my to-do list.

@marcusdarmstrong
Copy link
Contributor Author

Thanks for writing tests for me!

@sokra sokra closed this Oct 17, 2018
@sokra sokra reopened this Oct 17, 2018
@webpack-bot
Copy link
Contributor

The basic integration tests failed.

@sokra Please review the following output log for errors:

 FAIL  test/ConfigTestCases.test.js (77.272s)
  ● ConfigTestCases › externals › global › exported tests › should run the exported tests

    Timeout - Async callback was not invoked within the 30000ms timeout specified by jest.setTimeout.

      at mapper (node_modules/jest-jasmine2/build/queue_runner.js:41:52)
Show remaining errors
  ● ConfigTestCases › externals › global › exported tests › should move externals in chunks into entry chunk

    Timeout - Async callback was not invoked within the 30000ms timeout specified by jest.setTimeout.

      at mapper (node_modules/jest-jasmine2/build/queue_runner.js:41:52)
Test Suites: 1 failed, 2 passed, 3 total
Tests:       2 failed, 8 skipped, 1779 passed, 1789 total
Snapshots:   87 passed, 87 total
Time:        77.666s

See complete report here.

@sokra sokra merged commit 0fb6c60 into webpack:master Oct 17, 2018
@sokra
Copy link
Member

sokra commented Oct 17, 2018

Thanks

@marcusdarmstrong marcusdarmstrong deleted the marcusdarmstrong-external-module-fix branch October 17, 2018 15:38
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.

None yet

6 participants