diff --git a/packages/next/src/generators/application/application.ts b/packages/next/src/generators/application/application.ts index b82bf43371..81325c356b 100644 --- a/packages/next/src/generators/application/application.ts +++ b/packages/next/src/generators/application/application.ts @@ -18,10 +18,13 @@ import { addStyleDependencies } from '../../utils/styles'; import { addLinting } from './lib/add-linting'; import { customServerGenerator } from '../custom-server/custom-server'; import { updateCypressTsConfig } from './lib/update-cypress-tsconfig'; +import { showPossibleWarnings } from './lib/show-possible-warnings'; export async function applicationGenerator(host: Tree, schema: Schema) { const options = normalizeOptions(host, schema); + showPossibleWarnings(host, options); + const nextTask = await nextInitGenerator(host, { ...options, skipFormat: true, diff --git a/packages/next/src/generators/application/lib/show-possible-warnings.ts b/packages/next/src/generators/application/lib/show-possible-warnings.ts new file mode 100644 index 0000000000..7dba548a61 --- /dev/null +++ b/packages/next/src/generators/application/lib/show-possible-warnings.ts @@ -0,0 +1,10 @@ +import { logger, Tree } from '@nx/devkit'; +import { NormalizedSchema } from './normalize-options'; + +export function showPossibleWarnings(tree: Tree, options: NormalizedSchema) { + if (options.style === '@emotion/styled' && options.appDir) { + logger.warn( + `Emotion may not work with the experimental appDir layout. See: https://beta.nextjs.org/docs/styling/css-in-js` + ); + } +}