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

fix: prepend entrypoints instead of append #2699

Closed

Conversation

ScriptedAlchemy
Copy link
Member

  • This is a bugfix
  • This is a feature
  • This is a code refactor
  • This is a test update
  • This is a docs update
  • This is a metadata update

For Bugs and Features; did you add new tests?

this resolves an issue with module federation

re #2692

Motivation / Use-Case

Module Federation will not work with WDS in its current state

Breaking Changes

Additional Info

@ScriptedAlchemy
Copy link
Member Author

Tests still need to be written

@ScriptedAlchemy ScriptedAlchemy changed the title fix: prepend entrypoints instead od append fix: prepend entrypoints instead of append Aug 10, 2020
this resolves an issue with module federation

re webpack#2692
@codecov
Copy link

codecov bot commented Aug 10, 2020

Codecov Report

Merging #2699 (95fe365) into master (4ab1f21) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2699   +/-   ##
=======================================
  Coverage   93.77%   93.77%           
=======================================
  Files          34       34           
  Lines        1333     1333           
  Branches      381      381           
=======================================
  Hits         1250     1250           
  Misses         81       81           
  Partials        2        2           
Impacted Files Coverage Δ
lib/utils/addEntries.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ab1f21...95fe365. Read the comment docs.

@alexander-akait
Copy link
Member

Thanks!

@alexander-akait
Copy link
Member

In my TODO

@ScriptedAlchemy
Copy link
Member Author

Thanks!

@knagaitsev
Copy link
Collaborator

@ScriptedAlchemy Did you test this locally, and did it solve the issue? If so, was it with webpack@5?

From my tests, it appears that this does not solve the problem for webpack@5. Webpack 5 seems to not handle entries correctly if they are added on after the compiler is created, regardless of if they are appended or prepended. Basically, if any entry is added onto the entry array, the module that was supposed to be exported will be ignored, and just an empty object will be exported, no matter what has been added to the entry array.

I got the same result as described here: #2719 (comment)

This may need to be solved on the webpack side, so that entries can be injected after the compiler is created without causing problems.

@alexander-akait
Copy link
Member

Fixed in master, anyway thanks for the PR

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

Successfully merging this pull request may close these issues.

None yet

3 participants