fluent-compiler (v0.1.0, stable pre-release) is a JavaScript transpiler for Project Fluent's FTL format. It compiles FTL messages into ES6 modules that export FluentBundle-compatible objects, shifting compilation from runtime to build time. Unlike the core `fluent` package (which ships a ~10kB runtime compiler), `fluent-compiler` outputs pre-compiled code with a ~1.2kB runtime dependency, reducing browser bundle size. It supports locale identifiers, optional AST input from `fluent-syntax`, configurable runtime imports, and Unicode isolation marks. Suitable for Node.js >=8.9.0 and build pipelines (Webpack, Rollup). Note: The runtime API is based on a draft PR (#360) and may change.
No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
The package is ESM-only and does not export a CommonJS default. In older Node.js or CJS environments, use dynamic import or transpile.
The generated module uses ESM default export. If consumed from CJS, use dynamic import or compile with CommonJS output.
Main package does not export types; runtime types may be available from the runtime path or `fluent` package.
Shows end-to-end usage: compile FTL to JS, then import and use the pre-compiled bundle with format().
Breaking-change detection hasn't run for this library yet.
CVE tracking and dependency tree are planned for a later release.