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

Production builds can result in a different import vs. execution order #11617

Closed
thecrypticace opened this issue Oct 9, 2020 · 0 comments · Fixed by #11620
Closed

Production builds can result in a different import vs. execution order #11617

thecrypticace opened this issue Oct 9, 2020 · 0 comments · Fixed by #11620
Projects

Comments

@thecrypticace
Copy link

Bug report

It's possible for the presence of imports in imported files to affect execution order in a production build. The mere addition or removal of imports can cause modules to be executed in an order different than they're specified in the source.

What is the current behavior?
A production build can execute modules in a different order than they are imported.

If the current behavior is a bug, please provide the steps to reproduce.
Reproduction Repo: https://github.com/thecrypticace/webpack-import-order-bug

What is the expected behavior?
Adding or removing imported dependencies from node_modules should not change execution order regardless of development mode versus production mode.
I would expect all the code in b.js to run and then the code in c.js when I write:

// a.js
import "./b"
import "./c"

Other relevant information:
webpack version: 5.0.0 RC 4
Node.js version: 14.13.1
Operating System: macOS Catalina 10.15.7
Additional tools: Yarn 1.22.10

sokra added a commit that referenced this issue Oct 9, 2020
@sokra sokra added this to Blocking in webpack 5 Oct 9, 2020
@sokra sokra moved this from Blocking to Done in webpack 5 Oct 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

2 participants