hustcc / timeago.js

:clock8: :hourglass: timeago.js is a tiny(2.0 kb) library used to format date with `*** time ago` statement.
https://timeago.org
MIT License
5.29k stars 411 forks source link

CDN Error: Uncaught ReferenceError: exports is not defined #243

Closed albrnick closed 2 years ago

albrnick commented 3 years ago

I've tried using the CDN version (since I just want to include this in my straight html page), but the CDN version:

gives the error:

Uncaught ReferenceError: exports is not defined

Thanks for your time!

RatherLogical commented 3 years ago

Try this: https://unpkg.com/timeago.js/dist/timeago.min.js Then reference the lib with timeago.format()

gregfr commented 2 years ago

Thanks a lot!! This should be in the doc...

hustcc commented 2 years ago

add browser: "dist/timeago.min.js" in package.json will be ok.