Open yoosif0 opened 4 years ago
It is expected, because we don't know value of variable, you can use const dir = myComplexFunction() ? 'secondaryApp' : 'firstApp'
, we are static analyzer, not dynamic, here docs https://webpack.js.org/api/module-methods/#dynamic-expressions-in-import, so we include all files
from ../../
in the second example
I think we should improve docs for this example
Bug report
What is the current behavior? Replacing a static string to a variable string in the dynamic import path change build time and change the size of the resulting build files.
The code snippet below results in fast and smaller builds
The code snippet below results in slow and larger builds
Here is a repo to reproduce the bug. You only need to
npm install
thennpm start
What is the expected behavior? There should be no difference in the resulting build files and time to build
Other relevant information: webpack version: 4.44.1 Node.js version: 12.18.3 Operating System: Windows Additional tools: