Skip to content
Discussion options

You must be logged in to vote

@AFCMS change the order of babel plugin with react plugin:

import { lingui, linguiTransformerBabelPreset } from "@lingui/vite-plugin";
import babel from "@rolldown/plugin-babel";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";

export default defineConfig({
  plugins: [
    babel({ presets: [linguiTransformerBabelPreset()] }), // <-- should be before React plugin, to be able to transform Trans tags before react compiler transform them
    react({ compiler: true }),
    lingui(),
  ],
});

I tested it on your example and it works.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@AFCMS
Comment options

Answer selected by timofei-iatsenko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants