From 25592024cb0a5df40787ca7715d90afc73fca1cf Mon Sep 17 00:00:00 2001 From: Abhinav Date: Thu, 6 Apr 2023 18:20:45 +0530 Subject: [PATCH] updated emotion compiler import map to fix nested component ref not handled issue --- next.config.js | 21 +++++++++++++++++++++ tsconfig.json | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/next.config.js b/next.config.js index 601f9534d..e05ac9f85 100644 --- a/next.config.js +++ b/next.config.js @@ -23,6 +23,27 @@ const IS_SENTRY_ENABLED = getIsSentryEnabled(); module.exports = (phase) => withSentryConfig( withBundleAnalyzer({ + compiler: { + emotion: { + importMap: { + '@mui/material': { + styled: { + canonicalImport: ['@emotion/styled', 'default'], + styledBaseImport: ['@mui/material', 'styled'], + }, + }, + '@mui/material/styles': { + styled: { + canonicalImport: ['@emotion/styled', 'default'], + styledBaseImport: [ + '@mui/material/styles', + 'styled', + ], + }, + }, + }, + }, + }, transpilePackages: [ '@mui/material', '@mui/system', diff --git a/tsconfig.json b/tsconfig.json index 770160529..d1614a985 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,6 +23,6 @@ "jsxImportSource": "@emotion/react", "incremental": true }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.js"], "exclude": ["node_modules", "out", ".next", "thirdparty"] }