{"library":"rollup-plugin-formatjs","title":"rollup-plugin-formatjs","description":"A Rollup and Vite plugin that applies formatjs (react-intl) message extraction and translation transforms during the build process. Version 3.0.0 is the latest stable release, with monthly updates. It seamlessly integrates with the formatjs ecosystem, supporting both Rollup (^3) and Vite via plugin-compat. Unlike manual extraction, this automates the pipeline from source code to compiled messages, reducing configuration overhead. Ships TypeScript definitions.","language":"javascript","status":"active","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-plugin-formatjs"],"cli":null},"imports":["import formatjs from 'rollup-plugin-formatjs'","const formatjs = require('rollup-plugin-formatjs')","import type { FormatjsOptions } from 'rollup-plugin-formatjs'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import formatjs from 'rollup-plugin-formatjs';\nimport { defineConfig } from 'rollup';\n\nexport default defineConfig({\n  input: 'src/index.js',\n  plugins: [\n    formatjs({\n      idInterpolationPattern: '[sha512:contenthash:base64:6]',\n      ast: true,\n      extractFromFormatMessageCall: true,\n      additionalFunctionNames: [],\n      additionalComponentNames: [],\n      removeDefaultMessage: false,\n      overrideIdFn: undefined,\n      sourceMaps: false,\n      include: '**/*.{js,ts,jsx,tsx}',\n      exclude: 'node_modules/**'\n    })\n  ],\n  output: { file: 'dist/bundle.js', format: 'es' }\n});","lang":"typescript","description":"Basic Rollup config that applies formatjs transforms to source files, generating compiled message IDs and optimizations.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}