@lingui/vite-plugin v4.13.0
@lingui/vite-plugin
Vite plugin that compiles Lingui catalogs on the fly. In summary, the
lingui compile
command isn't needed when using this plugin.
@lingui/vite-plugin
is part of LinguiJS. See the documentation for all information, tutorials and examples.
Installation
npm install --save-dev @lingui/vite-plugin
# yarn add --dev @lingui/vite-plugin
Usage
Via vite.config.ts
import { UserConfig } from 'vite';
import { lingui } from '@lingui/vite-plugin'
const config: UserConfig = {
plugins: [lingui()]
}
Then in Vite-processed code:
// *.po files assigned to this loader by default
const { messages } = await import(`./locales/${language}.po`);
// for other extension you have to use `?lingui` suffix
const { messages } = await import(`./locales/${language}.json?lingui`);
See Vite's official documentation for more info about Vite dynamic imports https://vitejs.dev/guide/features.html#dynamic-import
License
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
7 months ago
8 months ago
7 months ago
6 months ago
9 months ago
9 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
12 months ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago