Registry / web-framework / unplugin-fluent-vue

unplugin-fluent-vue

JSON →
library1.4.1jsnpmunverified

unplugin-fluent-vue is a build tool plugin that integrates Fluent.js for internationalization (i18n) into Vue.js projects. It provides support for defining Fluent messages directly within Vue Single File Components (SFCs) using custom blocks, or by referencing external `.ftl` (Fluent Translation List) files. It currently stands at version 1.4.1 and sees regular maintenance releases, with the latest update in April 2026. This unplugin differentiates itself by offering a unified API for Vite, Webpack, and Rollup, leveraging the unplugin ecosystem. Key features include syntax checking for Fluent messages, optional in-build FTL parsing, and dedicated plugins for SFC-based or external file-based message definitions, making it a flexible choice for Vue i18n with Fluent.

npm install unplugin-fluent-vue
INSTALL
IMPORT
SIG · UNPLUGIN-FLUENT-VU
U
unplugin-fluent-vue
web-frameworkjavascriptv1.4.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SFCFluentPlugin
import { SFCFluentPlugin } from 'unplugin-fluent-vue/vite'
import { SFCFluentPlugin } from 'unplugin-fluent-vue'
Import path depends on your build tool (e.g., '/vite', '/webpack', '/rollup'). This example is for Vite. Make sure to choose the correct entry point.
ExternalFluentPlugin
import { ExternalFluentPlugin } from 'unplugin-fluent-vue/webpack'
import { ExternalFluentPlugin } from 'unplugin-fluent-vue'
Import path depends on your build tool (e.g., '/vite', '/webpack', '/rollup'). This example is for Webpack. This plugin supports external .ftl files.
FluentVue
import FluentVue from '@fluent/vue'
import { FluentVue } from 'unplugin-fluent-vue'
FluentVue is the runtime Vue plugin from the `@fluent/vue` package, not directly from `unplugin-fluent-vue`. This unplugin only handles build-time compilation.

Demonstrates how to configure unplugin-fluent-vue in a Vite project, showcasing both SFC-based and external FTL file approaches for i18n.

import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue'; import { ExternalFluentPlugin, SFCFluentPlugin } from 'unplugin-fluent-vue/vite'; import path from 'path'; export default defineConfig({ plugins: [ vue(), // Option 1: Define messages within Vue SFCs using <fluent> blocks SFCFluentPlugin({ blockType: 'fluent', // default 'fluent' checkSyntax: true, // default true parseFtl: false // default false }), // Option 2: Define messages in external .ftl files ExternalFluentPlugin({ baseDir: path.resolve(__dirname, 'src'), // required: base directory for Vue files ftlDir: path.resolve(__dirname, 'src/locales'), // required: directory with ftl files locales: ['en', 'da'], // required: list of supported locales checkSyntax: true, // default true parseFtl: false // default false. Set to true to pre-parse ftl at build time. }) ] }); // Example Vue SFC (src/App.vue): // <template> // <p>{{ $t('greeting', { name: 'World' }) }}</p> // </template> // <script setup> // import { useFluent } from 'fluent-vue'; // const { $t } = useFluent(); // </script> // <fluent> // greeting = Hello, { $name }! // </fluent> // Example FTL file (src/locales/en/messages.ftl): // greeting = Hello, { $name } from FTL!
Debug
Known issues
gotchaThe import path for the unplugin changes based on your bundler. Ensure you use `/vite`, `/webpack`, or `/rollup` suffix for the import.
fix
Correct `import { ... } from 'unplugin-fluent-vue/[bundler]'` where `[bundler]` is `vite`, `webpack`, or `rollup`.
affects: >=1.0.0
breakingThe `parseFtl` option for `SFCFluentPlugin` and `ExternalFluentPlugin` was introduced in v1.4.0. Prior versions did not support build-time parsing of FTL, relying solely on runtime parsing.
fix
Upgrade to v1.4.0 or newer to use the `parseFtl` option for potentially improved performance by parsing FTL files during the build process.
affects: <1.4.0
gotchaIf you are using this plugin with Nuxt, you must ensure `@nuxt/kit` is installed, although it's listed as an optional peer dependency. Without it, the Nuxt module integration will not function.
fix
Install `@nuxt/kit` if you intend to use the Nuxt module functionality: `npm install @nuxt/kit` or `yarn add @nuxt/kit`.
affects: >=1.3.0
gotchaThe plugin's primary role is build-time transformation. You still need the `@fluent/vue` package for the runtime integration within your Vue application (e.g., `useFluent`, `$t`).
fix
Install `@fluent/vue` separately: `npm install @fluent/vue` and set up the FluentVue plugin in your main.ts/js.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'unplugin-fluent-vue/vite'
Incorrect bundler-specific import path or missing unplugin-fluent-vue package.
fix
Ensure 'unplugin-fluent-vue' is installed. Verify the import path matches your bundler (e.g., `/vite` for Vite, `/webpack` for Webpack).
Failed to resolve import "@fluent/vue" from "src/main.js". The package "@fluent/vue" is not exported by "node_modules/unplugin-fluent-vue/package.json"
Attempting to import `@fluent/vue` from `unplugin-fluent-vue`. They are separate packages.
fix
Install `@fluent/vue` as a direct dependency: `npm install @fluent/vue` and import from `@fluent/vue` instead.
[unplugin-fluent-vue] No locales defined for ExternalFluentPlugin.
The `locales` option is missing or empty in the `ExternalFluentPlugin` configuration.
fix
Provide an array of locale strings to the `locales` option, e.g., `locales: ['en', 'es']`.
[Vue warn]: A plugin must either be an object with an install method or a function. Did you forget to call .use()?
Attempting to use `unplugin-fluent-vue`'s build-time plugins directly as a Vue plugin.
fix
The plugins from `unplugin-fluent-vue` are for your build configuration (e.g., `vite.config.js`). For runtime Vue integration, use `@fluent/vue` and its `createFluent` function.
Upgrade
Version history
1.4.1latest on npm
Audit
Dependencies
@fluent/bundlerequiredCore dependency for Fluent.js message parsing and formatting. Required for runtime message handling.
@nuxt/kitoptionalRequired only if using the plugin specifically as a Nuxt module (available since v1.3.0).
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
1
Resources
unplugin-fluent-vue — npm install unplugin-fluent-vue · libregistry