# project-fluent-loader

> This loader is for webpack and loads translation files for project Fluent

Latest version **0.0.2** (published 2022-11-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install project-fluent-loader
pnpm add project-fluent-loader
yarn add project-fluent-loader
bun add project-fluent-loader
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2022-11-02 |
| First published | 2022-11-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Boris Astanin |
| Maintainers | astanin |
| Keywords | webpack, loader, project-fluent, i18n, l10n |

## Links

- npm: https://www.npmjs.com/package/project-fluent-loader
- Repository: https://github.com/ShadyMind/project-fluent-loader
- Issues: https://github.com/ShadyMind/project-fluent-loader/issues
- npm.io page: https://npm.io/package/project-fluent-loader

## Alternatives

- [messageformat](https://npm.io/package/messageformat.md) — 329.7K weekly downloads
- [@mintlify/scraping](https://npm.io/package/@mintlify/scraping.md) — 294.8K weekly downloads
- [@mintlify/previewing](https://npm.io/package/@mintlify/previewing.md) — 209.5K weekly downloads
- [@mintlify/prebuild](https://npm.io/package/@mintlify/prebuild.md) — 209.5K weekly downloads
- [@mintlify/link-rot](https://npm.io/package/@mintlify/link-rot.md) — 206.3K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2022-11-02
- 0.0.1-b — 2022-11-02
- 0.0.1 — 2022-11-02
- 0.0.1-a — 2022-11-02

## README

# project-fluent-loader

This loader is for [webpack](https://webpack.js.org/) and loads translation files for [project Fluent](https://projectfluent.org/). It have very simple and naive realization, but works well.

## Installation

### Via npm:
```bash
npm install --save @fluent/bundle project-fluent-loader
```

### Via yarn:
```bash
yarn add @fluent/bundle project-fluent-loader
```

## Configuration
default extension for project-fluent files is `.ftl`. I recommend to use it. In this case we need to add only loader to webpack config to work with this kind of files:
```javascript
/** @file webpack.config.js */

module.exports = {
  module: {
    rules: [
      {
        test: /\.ftl$/,
        loader: 'project-fluent-loader'
      }
    ]
  }
};
```

## Usage
Importing file returns default instanced of FluentResource from `@fluent/bundle`:

```javascript
/** @file translation.ts */
import enGB from './en-GB.ftl';

export const l10n = new ReactLocalization();
l10n.addBundle(enGB);
```

## Typings
Just add `"project-fluent-loader"` to `#compilerOptions.lib` array in your `tsconfig.json` config:
```jsonc
{
  "compilerOptions": {
    "lib": [
      "project-fluent-loader"
    ]
  }
}
```
Or if you prefer to use different file format use declaration from [this file](./module.d.ts).

---
_Source: https://npm.io/package/project-fluent-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
