@formatjs/unplugin weekly downloads statistics
By formatjs (2 listings) · npm · Vite plugins
Universal build plugin for FormatJS — supports Vite, Webpack, Rollup, esbuild, Rspack, and Rsbuild
@formatjs/unplugin has 111,679 recorded weekly downloads on npm, an increase of 4.6% over the past 30 days, ranking #627 of 3,247 tracked listings.
About @formatjs/unplugin
@formatjs/unplugin
Universal build plugin for FormatJS AST transformations. Supports Vite, Webpack, Rollup, esbuild, Rspack, and Rsbuild with one codebase.
Replicates the functionality of babel-plugin-formatjs and @formatjs/ts-transformer using oxc-parser + magic-string for fast, compiler-agnostic builds.
Installation
npm install @formatjs/unplugin --save-dev
Usage
Vite
// vite.config.ts
import {defineConfig} from 'vite'
import formatjs from '@formatjs/unplugin/vite'
export default defineConfig({
plugins: [
formatjs({
idInterpolationPattern: '[sha512:contenthash:base64:6]',
ast: true,
}),
],
})
Webpack
// webpack.config.js
const formatjs = require('@formatjs/unplugin/webpack').default
module.exports = {
plugins: [
formatjs({
idInterpolationPattern: '[sha512:contenthash:base64:6]',
ast: true,
}),
],
}
Rollup
// rollup.config.js
import formatjs from '@formatjs/unplugin/rollup'
export default {
plugins: [
formatjs({
idInterpolationPattern: '[sha512:contenthash:base64:6]',
ast: true,
}),
],
}
esbuild
import esbuild from 'esbuild'
import formatjs from '@formatjs/unplugin/esbuild'
esbuild.build({
plugins: [
formatjs({
idInterpolationPattern: '[sha512:contenthash:base64:6]',
ast: true,
}),
],
})
Rspack
// rspack.config.js
const formatjs = require('@formatjs/unplugin/rspack').default
module.exports = {
plugins: [
formatjs({
idInterpolationPattern: '[sha512:contenthash:base64:6]',
ast: true,
}),
],
}
Rsbuild
// rsbuild.config.ts
import {defineConfig} from '@rsbuild/core'
import formatjs from '@formatjs/unplugin/rsbuild'
export default defineConfig({
plugins: [
formatjs({
idInterpolationPattern: '[sha512:contenthash:base64:6]',
ast: true,
}),
],
})
Static message values
On FreeBSD x64, static evaluation uses the optional @formatjs/cli-native-freebsd-x64 package.
Message fields can reference local const strings, including aliases, templates,
string concatenations, and constant conditionals. OXC performs native scope analysis and static evaluation through
@formatjs/cli-lib. Constants must be initialized before the reference. Lexical scope
and shadowing are respected for JSX and message descriptors.
function Greeting() {
const greeting = 'Hello'
return <FormattedMessage defaultMessage={greeting} />
}
Imported values, mutable bindings, destructured bindings, and runtime expressions remain unresolved. Keep those message fields inline when they need generated IDs or precompiled ASTs.
Native expression evaluation supports macOS arm64, Linux x64/arm64 (glibc and musl), and Windows x64.
Options
| Option | Type | Default | Description |
|---|---|---|---|
idInterpolationPattern | string | [sha512:contenthash:base64:6] | Pattern for generating message IDs |
overrideIdFn | function | — | Custom function to generate message IDs |
removeDefaultMessage | boolean | false | Remove defaultMessage from output |
additionalComponentNames | string[] | [] | Extra JSX component names to process |
additionalFunctionNames | string[] | [] | Extra function names to process |
ast | boolean | false | Pre-parse defaultMessage into AST |
preserveWhitespace | boolean | false | Keep original whitespace in messages |
filter | HookFilter | JS/TS outside node_modules | Filter modules before transformation |
Transform Hook Filters
filter is forwarded to unplugin's transform.filter hook. Passing a custom filter replaces the default module policy, which matches JavaScript and TypeScript module IDs outside node_modules.
import formatjs from '@formatjs/unplugin/vite'
formatjs({
filter: {
id: /^(?!.*\/node_modules\/).*\.tsx?$|\/node_modules\/@my-org\/learning-block\/.*\.tsx?$/,
code: /FormattedMessage|defineMessages?|formatMessage|defaultMessage/,
},
})
Description from the npm listing.
- esbuild-plugin
- formatjs
- i18n
- internationalization
- react-intl
- rollup-plugin
- rsbuild-plugin
- rspack-plugin
- unplugin
- vite-plugin
- webpack-plugin
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm Vite plugins plugins
All 20 @formatjs/unplugin alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@formatjs/unplugin. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.