unplugin-fluent-vue
TypeScript icon, indicating that this package has built-in type declarations

1.4.0 • Public • Published

unplugin-fluent-vue

GitHub Workflow Status codecov Standard - JavaScript Style Guide GitHub license

fluent-vue plugin for Vite, Webpack and Rollup (thanks to unplugin).

It adds support for defining Fluent messages in Vue SFCs and external ftl files.

Installation

npm install unplugin-fluent-vue --save-dev

Usage

Vite

// vite.config.js
import {
  ExternalFluentPlugin,
  SFCFluentPlugin,
} from 'unplugin-fluent-vue/vite'
import { defineConfig } from 'vite'

export default defineConfig({
  plugins: [
    vue(),
    // Choose one of the following:
    SFCFluentPlugin({ // define messages in SFCs
      blockType: 'fluent', // default 'fluent' - name of the block in SFCs
      checkSyntax: true, // default true - whether to check syntax of the messages
      parseFtl: false, // default false - whether to parse ftl files during build
    }),
    ExternalFluentPlugin({ // define messages in external ftl files
      baseDir: path.resolve('src'), // required - base directory for Vue files
      ftlDir: path.resolve('src/locales'), // required - directory with ftl files
      locales: ['en', 'da'], // required - list of locales
      checkSyntax: true, // default true - whether to check syntax of the messages
      parseFtl: false, // default false - whether to parse ftl files during build
    }),
  ],
})

Docs: https://fluent-vue.demivan.me/integrations/unplugin.html

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.4.0731latest

Version History

VersionDownloads (Last 7 Days)Published
1.4.0731
1.3.2317
1.3.10
1.3.021
1.2.00
1.1.40
1.1.30
1.1.23
1.1.10
1.1.00
1.0.00
0.1.00
0.0.30
0.0.20
0.0.11

Package Sidebar

Install

npm i unplugin-fluent-vue

Weekly Downloads

1,035

Version

1.4.0

License

MIT

Unpacked Size

86.4 kB

Total Files

49

Last publish

Collaborators

  • demivan