Hi WP Team, congrats on the major version bump, and thank you for all of your hard work this year! Filing this in response to a tweet, would be great to get ETA on docs for
ModuleConcatentationPlugin. We’re aware it’s an experimental feature. Keep us posted. Thanks!
Do you want to request a feature or report a bug?
What is the current behavior?
Medium sized JS app. 80k LOC, 100s of modules.
3.0.0 works fine, no issues.
Build fails when adding
With no other configuration changes, I get the following output:
ERROR in chunk main [entry] scripts.bundle.js Cannot map to variable name in module /Users/sdt/te/frontend/src/app/domainData/api/entities/elements/index.js (export 'COMMON_HEADERS')
Again, this only happens when adding
ModuleConcatentationPlugin, build works fine without it.
Unfortunately, my team is on a deadline and I’m unable to provide a minimal reproduceable repo. I’m filing this issue in hopes that someone has an idea of what might be wrong. I’ve tried this >6 times with re-cloning of the repos and a restart of my machine. It’s possible I’ve left something out and this is a simple fix.
The best I can do is upgrade us to
3.0.0 (which doesn’t break our builds), and stay on top of this issue. If you have tips for how to create a minimal repo, let me know — seems tough with how big our project is, I’m unsure where to start creating a failure case from a smaller repo. I’ve subscribed to the issue and am happy to provide more context: thanks for your attention!
What is the expected behavior?
The failed mapping is an api constant (for headers) and used in over a dozen other files successfully in 2.6.1, both in prod and dev builds. We have changed only two things: webpack version, and a one-line addition of the plugin.
The expected behavior is to not get this error (or any other future errors), and have a successful build.
If this is a feature request, what is motivation or use case for changing the behavior?
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
Version 58.0.3029.110 (64-bit)
OSX Sierra, Version 10.12.4 (16E195)