Skip to content

Commit

Permalink
Add src directory support for global CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
ykzts committed Oct 8, 2019
1 parent afaff59 commit 74aad4e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,10 @@ export default async function getBaseWebpackConfig(
: config.crossOrigin

let customAppFile: string | null = config.experimental.css
? await findPageFile(
path.join(dir, 'pages'),
'/_app',
config.pageExtensions
)
? await findPageFile(pagesDir, '/_app', config.pageExtensions)
: null
if (customAppFile) {
customAppFile = path.resolve(path.join(dir, 'pages', customAppFile))
customAppFile = path.resolve(path.join(pagesDir, customAppFile))
}

let webpackConfig: webpack.Configuration = {
Expand Down Expand Up @@ -668,7 +664,7 @@ export default async function getBaseWebpackConfig(
'Custom <App>'
)}. Please move all global CSS imports to ${chalk.cyan(
customAppFile
? path.relative(dir, customAppFile)
? path.relative(pagesDir, customAppFile)
: 'pages/_app.js'
)}.\n` +
`Read more: https://err.sh/next.js/global-css`,
Expand Down

0 comments on commit 74aad4e

Please sign in to comment.