From ff7f9d68d5361ddf8a8355b3ef59991af0e07a26 Mon Sep 17 00:00:00 2001 From: Apoorv Mishra Date: Tue, 14 Nov 2023 09:56:24 +0530 Subject: [PATCH] fix: restore working of babel-plugin-styled-components (#6140) --- vite.config.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/vite.config.ts b/vite.config.ts index 60600d4fd..be9333b34 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -48,6 +48,27 @@ export default () => // https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#readme react({ babel: { + env: { + production: { + plugins: [ + [ + "babel-plugin-styled-components", + { + displayName: false, + }, + ], + ], + }, + }, + plugins: [ + [ + "babel-plugin-styled-components", + { + displayName: true, + fileName: false, + }, + ], + ], parserOpts: { plugins: ["decorators-legacy", "classProperties"], },