@verbaly/unplugin
v0.38.0
Published
Verbaly for webpack, Rollup, esbuild and Rspack: extraction, virtual modules and build gate via unplugin.
Maintainers
Readme
Verbaly beyond Vite: the same compiler (typed virtual:verbaly module, per-locale code-splitting and the missing-translation build gate) wrapped with unplugin so it runs on webpack 5, Rollup, esbuild, Rspack (and Vite, though @verbaly/vite is richer there: live extraction + HMR).
🚀 Install
pnpm add verbaly @verbaly/unplugin// webpack.config.mjs
import { verbaly } from '@verbaly/unplugin';
export default {
plugins: [verbaly.webpack({ sourceLocale: 'en', locales: ['en', 'es', 'pt'] })],
};// rollup.config.mjs
import { verbaly } from '@verbaly/unplugin';
export default { plugins: [verbaly.rollup({ locales: ['en', 'es'] })] };
// esbuild
verbaly.esbuild({ locales: ['en', 'es'] });
// rspack
verbaly.rspack({ locales: ['en', 'es'] });Extraction runs via the CLI: add it to your dev loop or CI:
npx verbaly extract # scan sources, sync catalogs, write verbaly.d.ts
npx verbaly extract --watch # keep extracting as you code (dev loop)- Same virtual module:
import { t, setLocale } from 'virtual:verbaly'. - Build gate: missing translations fail the build (
failOnMissing: falseto opt out). - ESM-only, like the compiler. Use
webpack.config.mjs(or"type": "module").
📖 Docs & live playground: https://verbaly-web.vercel.app
⚠️ Early development (
0.x): API not stable yet.
License
MIT © Aron Soto
