unplugin-lingui-loader
v0.1.0
Published
Lingui loader for Vite, Rollup, Webpack, and more
Downloads
78
Maintainers
Readme
unplugin-lingui-loader
It’s a good practice to use compiled message catalogs during development. However, running compile
everytime messages are changed soon becomes tedious.
unplugin-lingui-loader
is plugin for Vite, Rollup, Webpack, and more, which compiles messages on the fly!
Install
npm i -D unplugin-lingui-loader
// vite.config.ts
import PoLoader from 'unplugin-lingui-loader/vite'
export default defineConfig({
plugins: [
PoLoader(),
],
})
Example: playground/
// rollup.config.js
import PoLoader from 'unplugin-lingui-loader/rollup'
export default {
plugins: [
PoLoader(),
],
}
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-lingui-loader/webpack')()
]
}
// nuxt.config.js
export default {
buildModules: [
['unplugin-lingui-loader/nuxt'],
],
}
This module works for both Nuxt 2 and Nuxt Vite
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-lingui-loader/webpack')(),
],
},
}
// esbuild.config.js
import { build } from 'esbuild'
import PoLoader from 'unplugin-lingui-loader/esbuild'
build({
plugins: [PoLoader()],
})