diff --git a/packages/next/src/generators/application/files/.babelrc__tmpl__ b/packages/next/src/generators/application/files/.babelrc__tmpl__ index c77984e670415..d9daea395c5c6 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 }]<% } %> ] }