ICU message format compiler that converts ICU strings into a compact JSON array representation at build time, with a runtime bundle of only 650 bytes (minified + compressed) and zero runtime dependencies. Version 4.11.0 is current, released under the next-intl monorepo with frequent updates (multiple releases per month). Key differentiators: extremely small runtime footprint, full ICU support (plural, select, selectordinal, date, time, number, tags), and TypeScript-first design. Unlike alternatives like icu-to-json or @lingui/message-utils, icu-minify offers first-class ESM support, no polyfills needed, and seamless integration with next-intl.
npm install icu-minifyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Compiles an ICU message string at build time and formats it at runtime with arguments.
Validate ICU syntax with a linter like intl-messageformat-parser before compilation.
Use Intl.getCanonicalLocales() to normalize locale strings.
Update imports to 'icu-minify/compile' and 'icu-minify/format'.
Ensure your environment supports Intl.NumberFormat and Intl.DateTimeFormat for the locales you use.
Pass a tags object like { bold: (text) => `<b>${text}</b>` } as the fourth argument.Treat compiled messages as immutable constants.
Upgrade to icu-minify@4.0.0+ and ensure node version supports exports field (Node >=12.7).
Change import to: import compile from 'icu-minify/compile';
Use a linter or parser to validate the ICU string before passing to compile().
Ensure locale is a string and that Intl.DateTimeFormat/NumberFormat supports it. Check arguments: format(compiled, locale, values, tags?).
No dependency data recorded yet.