fix(nextjs): show a warning when user uses emotion with appDir layout (#16636)
This commit is contained in:
parent
920352215c
commit
a7c4009d28
@ -18,10 +18,13 @@ import { addStyleDependencies } from '../../utils/styles';
|
|||||||
import { addLinting } from './lib/add-linting';
|
import { addLinting } from './lib/add-linting';
|
||||||
import { customServerGenerator } from '../custom-server/custom-server';
|
import { customServerGenerator } from '../custom-server/custom-server';
|
||||||
import { updateCypressTsConfig } from './lib/update-cypress-tsconfig';
|
import { updateCypressTsConfig } from './lib/update-cypress-tsconfig';
|
||||||
|
import { showPossibleWarnings } from './lib/show-possible-warnings';
|
||||||
|
|
||||||
export async function applicationGenerator(host: Tree, schema: Schema) {
|
export async function applicationGenerator(host: Tree, schema: Schema) {
|
||||||
const options = normalizeOptions(host, schema);
|
const options = normalizeOptions(host, schema);
|
||||||
|
|
||||||
|
showPossibleWarnings(host, options);
|
||||||
|
|
||||||
const nextTask = await nextInitGenerator(host, {
|
const nextTask = await nextInitGenerator(host, {
|
||||||
...options,
|
...options,
|
||||||
skipFormat: true,
|
skipFormat: true,
|
||||||
|
|||||||
@ -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`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user