Using the following code to do the Sinization of the time,
it is failed by parcel. But by webpack锛宨t is ok.
Can you help me?
import moment from 'moment';
import 'moment/locale/zh-cn'
moment.locale('zh-cn');

What is the error that parcel throws? Or none?
I do have a similar issue. Parcel works fine, but the second import does not do what it should.
It is supposed to modify the moment global variable to add stuff into it, but I guess it cannot access moment as it's not global?
check pr #530 and see if it works.
@PlayMa256 it shouldn't work on this case.
The problem :
import moment from 'moment' is resolved to an ES6 module, according to the module package.json fieldimport 'moment/locale/zh-cn' is resolved to an UMD module, which uses the moment commonjs moduleWhat it means : you are using ES6 moment, the locale uses CommonJS moment, it's two different instances, so the locale will not apply.
Workaround (pick one) :
moment.locale('zh-cn', locale)
```
js
import moment from 'moment/moment'
Caused by #299 (follow up #359), related to #418
in my case, this is what fix it:
import * as moment from 'moment/moment';
import 'moment/locale/fr';
Should have been fixed
Most helpful comment
@PlayMa256 it shouldn't work on this case.
The problem :
import moment from 'moment'is resolved to an ES6 module, according to themodulepackage.jsonfieldimport 'moment/locale/zh-cn'is resolved to an UMD module, which uses the moment commonjs moduleWhat it means : you are using ES6 moment, the locale uses CommonJS moment, it's two different instances, so the locale will not apply.
Workaround (pick one) :
```js
import locale from 'moment/src/locale/zh-cn'
moment.locale('zh-cn', locale)
```
js import moment from 'moment/moment'Caused by #299 (follow up #359), related to #418