jsmreese / moment-duration-format

Format function plugin for the Moment Duration object.
MIT License
967 stars 121 forks source link

Fix es6 module loading issue #155

Open yulodl opened 2 years ago

yulodl commented 2 years ago

ref: https://github.com/moment/moment-timezone/blob/develop/moment-timezone.js#L21

sethreidnz commented 1 year ago

@jsmreese Any updates on if this will be merged and released? Trying really hard to figure out how to get around this issue with modern tooling like vite but cannot figure it out. I've confirmed this does fix the issue I was having.

sethreidnz commented 1 year ago

I've created a fork that can be installed in place of this library in case anyone is having issues:

https://github.com/sethreidnz/moment-duration-format

npm install sethreidnz/moment-duration-format
realAP commented 2 weeks ago

I can't express how thankful I am. This has solved my entire problem.

For everyone using Vite and encountering an issue like "TypeError: moment is not a function," this will fix it.

This solution works for both development and production builds.