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
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.jsto run and then the code inc.jswhen I write: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