Commit 32633c83 authored by Yamagishi Kazutoshi's avatar Yamagishi Kazutoshi Committed by JJ Kasper

Add src directory support for global CSS (#8999)

parent 3c978792
...@@ -299,14 +299,10 @@ export default async function getBaseWebpackConfig( ...@@ -299,14 +299,10 @@ export default async function getBaseWebpackConfig(
: config.crossOrigin : config.crossOrigin
let customAppFile: string | null = config.experimental.css let customAppFile: string | null = config.experimental.css
? await findPageFile( ? await findPageFile(pagesDir, '/_app', config.pageExtensions)
path.join(dir, 'pages'),
'/_app',
config.pageExtensions
)
: null : null
if (customAppFile) { if (customAppFile) {
customAppFile = path.resolve(path.join(dir, 'pages', customAppFile)) customAppFile = path.resolve(path.join(pagesDir, customAppFile))
} }
let webpackConfig: webpack.Configuration = { let webpackConfig: webpack.Configuration = {
...@@ -668,7 +664,7 @@ export default async function getBaseWebpackConfig( ...@@ -668,7 +664,7 @@ export default async function getBaseWebpackConfig(
'Custom <App>' 'Custom <App>'
)}. Please move all global CSS imports to ${chalk.cyan( )}. Please move all global CSS imports to ${chalk.cyan(
customAppFile customAppFile
? path.relative(dir, customAppFile) ? path.relative(pagesDir, customAppFile)
: 'pages/_app.js' : 'pages/_app.js'
)}.\n` + )}.\n` +
`Read more: https://err.sh/next.js/global-css`, `Read more: https://err.sh/next.js/global-css`,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment