diff --git a/server/build/webpack.js b/server/build/webpack.js index d080b1787ffeb..6fd1d8ab1d72d 100644 --- a/server/build/webpack.js +++ b/server/build/webpack.js @@ -47,7 +47,7 @@ export default async function createCompiler (dir, { buildId, dev = false, quiet ] } - const pages = await glob('pages/**/*.js', { cwd: dir }) + const pages = await glob(config.pagesGlobPattern, { cwd: dir }) const devPages = pages.filter((p) => p === 'pages/_document.js' || p === 'pages/_error.js') // In the dev environment, on-demand-entry-handler will take care of diff --git a/server/config.js b/server/config.js index 02812bf57c16e..7c61fdd384d52 100644 --- a/server/config.js +++ b/server/config.js @@ -10,7 +10,8 @@ const defaultConfig = { distDir: '.next', assetPrefix: '', configOrigin: 'default', - useFileSystemPublicRoutes: true + useFileSystemPublicRoutes: true, + pagesGlobPattern: 'pages/**/*.js' } export default function getConfig (dir, customConfig) {