ember-moment-shim
is an ember addon that generates the locales conditionally based on Moment.js and Moment-Timezone.
Any tools or processes to accomplish the same with just DayJs instead.
Ref: https://github.com/jasonmit/ember-cli-moment-shim
UPDATE:
I want to lazy load or dynamically load the dayJs locales based on the requirement. And every time you need to load a locale, you need to import it like
import fr from 'dayjs/locale/fr'
just that it would be a different locale every time and could change on refresh based on the settings from API response.
ember-auto-import
throws following Error
Uncaught SyntaxError: Cannot use import statement outside a module*
Addons like ember-cli-moment-shim are no longer required to use libraries from NPM instead you can use them directly after installing
ember-auto-import
.From the command line do:
Then you can just import dayjs where you need it.
For example in a component: