Optimizing for production
Tree-shake your code
Tree-shaking lets you bundle only the code you're using and eliminate the rest. For example, if you're only using Dinero.js to add and subtract monetary values, only dinero, add, subtract, and their dependencies should be in your final bundle.
Dinero.js is a pure library, meaning it doesn't produce side-effects. If you're using a modern build system, you can tree-shake it. To do so, make sure to import only the functions you need, and enable tree-shaking in your bundler configuration if necessary.
import { dinero, add, subtract } from 'dinero.js';
import { USD } from 'dinero.js/currencies';
// Only these functions end up in your bundleResources:
Compress your assets
If you're using the UMD build without a bundler, make sure to compress it before you serve it in production.
If you're importing Dinero.js via a CDN such as jsDelivr or cdnjs, you should get Gzip or Brotli compression out of the box. If you're hosting your own, make sure to use the production build and to compress it either manually or using an edge server like Cloudflare or Cloudfront.
Resources: