Dayjs not transpiling down to es5 on version 1.8.4, leaving es6 code in bundle. (the babel/ts webpack config is fine)
1.7.4 is the last known working version
@yyynnn Just checked the final code in v1.8.4, everything looks fine in es5.
Any further information please?
I've had the same issue after upgrading from 1.7.8 to 1.8.4, IE11 was logging a SyntaxError because of some arrow function in dayjs.
In dev mode, the error pointed to this line: https://github.com/iamkun/dayjs/blob/dev/src/index.js#L8
This is also happening to us. We are using an ejected version of create react app's webpack build script with minimal changes. The build script isn't able to minify the js. I believe this is because our build script is a little outdated. https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
Newer versions of create react app's webpack build script probably include a loader that transpiles node_modules that are included via the module package.json config option. IDK.
Should that change have been a major version bump?

When we remove the "module" property pointing to "./src/index.js" in our local dayjs module, our build process works successfully:

With the "module" property, it fails:

I think it might be related to https://github.com/iamkun/dayjs/pull/451.
We've added a "module" property in package.json file after v1.8.0+, and pointed to the /src folder which is the source code in es6 with import/export syntax.
This is to made our lib treeshakeable with the help of modern bundle tool like webpack.
This issue is an unexpected behavior, and should be fix in the coming hotfix in a few days.
Just I'm not sure how to fix this, if I point "module" to the compiled es5 code, that makes no sense.
Anyone could help?
@iamkun I think you have two options to fix this:
consts, and so on through babel.module field entirely. Then, publish a new major version with the module field back in and tell people to explicitly pass dayjs through babel themselves. This would mean any webpack users would have to add an exception in their babel loader includes / excludes for dayjs specifically. Not sure what the implication is for other module systems. This would make dayjs harder to use for people, but could have a small benefit in terms of module size.For what it's worth, I prefer the first option. I could open a PR for this too, if you're interested.
option 1 pr welcome 馃榿
Try hotfix v1.8.5, contains @Tvrqvoise's fix, hope this will help.
Confirmed that v1.8.5 works for me. Thanks @iamkun for the quick updates and the great library!
yeah cool
Most helpful comment
option 1 pr welcome 馃榿