Skip to content
This repository has been archived by the owner on Sep 17, 2022. It is now read-only.

fluent-vue Webpack loader that adds support for custom blocks in Vue SFC

License

Notifications You must be signed in to change notification settings

fluent-vue/fluent-vue-loader

Repository files navigation

⚠ DEPRECATED ⚠

Funtionatily was moved to unplugin-fluent-vue

fluent-vue-loader

GitHub Workflow Status codecov Standard - JavaScript Style Guide GitHub license

Webpack loader that allows to use Vue custom blocks for locale messages in fluent-vue

Installation

Add fluent-vue-loader to your dev-dependencies:

For npm users:

npm install fluent-vue-loader --save-dev

For yarn users:

yarn add fluent-vue-loader --dev

Add loader to your Webpack config

module.exports = {
  module: {
    rules: [
      // ...
      {
        resourceQuery: /blockType=fluent/,
        loader: 'fluent-vue-loader',
      },
      // ...
    ]
  }
}

Example

Example of App.vue with custom block:

<template>
  <p>{{ $t('hello') }}</p>
</template>

<script>
export default {
  name: 'app'
}
</script>

<fluent locale="en">
hello = hello world!
</fluent>