From 0841b554657dbb7ad8677ea476dceccaa3ddb096 Mon Sep 17 00:00:00 2001 From: Noriyuki Shinpuku Date: Thu, 19 Aug 2021 22:45:16 +0900 Subject: [PATCH] fix(nextjs): fix .babelrc for emotion v11 (#6728) --- .../application/files/.babelrc__tmpl__ | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/next/src/generators/application/files/.babelrc__tmpl__ b/packages/next/src/generators/application/files/.babelrc__tmpl__ index c77984e670..d9daea395c 100644 --- a/packages/next/src/generators/application/files/.babelrc__tmpl__ +++ b/packages/next/src/generators/application/files/.babelrc__tmpl__ @@ -1,6 +1,21 @@ { - "presets": ["@nrwl/next/babel"], + "presets": [ + <% if (style === '@emotion/styled') { %> + [ + "@nrwl/next/babel", + { + "preset-react": { + "runtime": "automatic", + "importSource": "@emotion/react" + } + } + ] + <% } else { %> + "@nrwl/next/babel" + <% } %> + ], "plugins": [ + <% if (style === '@emotion/styled') { %>"@emotion/babel-plugin"<% } %> <% if (style === 'styled-components') { %>["styled-components", { "pure": true, "ssr": true }]<% } %> ] }