'How to integrate typesafe-i18n with Vite bundler?
It's inconvenient to turn on the generator for typesafe-i18n. How to run it with Vite bundler?
Solution 1:[1]
After version 5.0 of typesafe-i18n there is no official way to integrate generator to bundler build pipeline (previously it was available via webpack or rollup plugin).
Now you can run synchroniously generator and Vite bundler by importing cli script into your config:
export default async ({ mode }: ConfigEnv) => {
const dev = mode === 'development';
if (!dev) {
process.argv.push('--no-watch');
}
await import(path.resolve('./node_modules/typesafe-i18n/cli/typesafe-i18n.mjs'));
// .. etc
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
