Locale Files as UMD or Browser Injectable Bundle
See original GitHub issueIn an application where users may have or switch to different locales, locale file should be in a format that can be injected with a script tag to the DOM. Like:
<script src="/js/dayjs-locales/en.umd.js" id="dayjs-locale-en"></script>
apart from solutions like dynamic import provided by webpack.
I achieved this once by coding a precompiler which transforms each locale file to a umd bundle but it was so fragile against library updates and turned back to import all locales to main build solution.
With proper bundling, we may inject and remove locale files at runtime, easily.
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Bundle Angular 2 app using UMD bundles (not building ...
I have to use a module loader, and it doesn't look like WebPack has one that will work for this. To assign UMD...
Read more >The JavaScript Modules Handbook – Complete Guide to ES ...
A module bundler is a tool developers use to bundle an app's modules and dependencies into a single browser-compatible JavaScript file. Why Do ......
Read more >How to Bundle JavaScript With Rollup — Step-by-Step Tutorial
Learn how to use Rollup as a smaller, more efficient alternative to webpack and Browserify to bundle JavaScript files in this step-by-step tutorial...
Read more >Building for Production - Vite
The production bundle assumes support for modern JavaScript. By default, Vite targets browsers which support the native ES Modules, native ESM dynamic import, ......
Read more >microbundle - npm
Microbundle produces esm , cjs , umd bundles with your code compiled to syntax that works pretty much everywhere. While it's possible to ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Load this via
scriptelementhttps://unpkg.com/dayjs/locale/uk, then you can usedayjs.locale('uk')That would be nice, please!