// rsbuild.config.tsimport {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
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.
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[]
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.