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
[bugfix] Make auto locale loading for node not mess webpack, fixes #4031, #2979, #3872 #4042
Conversation
Cannot import the locale relatively, since the code exists in a different location in the bundled ES5 module than it does in ES6. In order to run tests locally (where the external 'moment' library can't be loaded), fall back to using the relative import.
Yeah, that's a good change. Thanks. |
@ovangle can you provide some context please? What is broken, when, why. |
@ichernev Because webpack has no knowledge of the runtime it ignores the The fix is to import from I've stated elsewhere that I'd like this block of code removed entirely, because it isn't an ES6 compliant import (ES6 imports must be statically available), but that would be a breaking change, so I've "fixed" it for 2.x.x and will submit a fix for 3.x.x in the next couple of days. |
Actually looking at my changes now, I'm not so sure it resolves the issue... I tested installing from a git dependency before I added the fallback option, but I can't remember if I tested it after adding the fallback, I just noticed the unit tests were failing and it seemed like the obvious fix. Webpack might ignore the fact that the second require is inside a |
I installed it on a private project it using a git dependency. The |
Merged in 49819dc |
Reopening this PR now that tests are passing.
Cannot import the locale relatively, since the code exists
in a different location in the bundled ES5 module than it
does in ES6.
In order to run tests locally (where the external 'moment'
library can't be loaded), fall back to using the relative import.