Webpack loader

fluent-vue-loader allows you to use custom blocks in your single file components.

Example

<template>
  <div>
    <div>{{ $t('hello-user', { userName }) }}</div>
    <div>{{ $t('shared-photos', { userName, photoCount, userGender }) }}</div>
  </div>
</template>

<fluent locale="en">
# Simple things are simple.
hello-user = Hello, {$userName}!

# Complex things are possible.
shared-photos =
  {$userName} {$photoCount ->
     [one] added one photo
    *[other] added {$photoCount} new photos
  } to {$userGender ->
     [male] his stream
     [female] her stream
    *[other] their stream
  }.
</fluent>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

Instalation

  1. Install fluent-vue-loader package
yarn add fluent-vue-loader --dev
npm install fluent-vue-loader --save-dev
  1. Configure Webpack
module.exports = {
  // ...
  module: {
    rules: [
      {
        resourceQuery: /blockType=fluent/,
        loader: 'fluent-vue-loader',
      },
      // ...
    ],
  },
  // ...
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14