Handle windows backslashes when checking ssr-prepass (#8016)

This commit is contained in:
JJ Kasper 2019-07-17 11:21:24 -07:00 committed by Tim Neutkens
parent 8f662c44c9
commit 3c1355686a

View file

@ -247,7 +247,9 @@ export default async function getBaseWebpackConfig(
) {
// if it's the Next.js' require mark it as external
// since it's not used
if (context.includes('next-server/dist/server')) {
if (
context.replace(/\\/g, '/').includes('next-server/dist/server')
) {
return callback(undefined, `commonjs ${request}`)
}
}