Unverified Commit 899f21ff authored by Connor Davis's avatar Connor Davis Committed by GitHub

Dont prefetch with debug mode (#6895)

parent 8e51c78e
...@@ -431,7 +431,7 @@ export default class Router implements IRouterInterface { ...@@ -431,7 +431,7 @@ export default class Router implements IRouterInterface {
prefetch(url: string): Promise<void> { prefetch(url: string): Promise<void> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// Prefetch is not supported in development mode because it would trigger on-demand-entries // Prefetch is not supported in development mode because it would trigger on-demand-entries
if (process.env.NODE_ENV !== 'production') return if (process.env.NODE_ENV !== 'production' || process.env.__NEXT_EXPERIMENTAL_DEBUG) return
const { pathname } = parse(url) const { pathname } = parse(url)
// @ts-ignore pathname is always defined // @ts-ignore pathname is always defined
......
...@@ -267,6 +267,7 @@ export default function getBaseWebpackConfig (dir: string, {dev = false, debug = ...@@ -267,6 +267,7 @@ export default function getBaseWebpackConfig (dir: string, {dev = false, debug =
...(dev && !isServer ? { ...(dev && !isServer ? {
'process.env.__NEXT_DIST_DIR': JSON.stringify(distDir) 'process.env.__NEXT_DIST_DIR': JSON.stringify(distDir)
} : {}), } : {}),
'process.env.__NEXT_EXPERIMENTAL_DEBUG': JSON.stringify(debug),
'process.env.__NEXT_EXPORT_TRAILING_SLASH': JSON.stringify(config.experimental.exportTrailingSlash) 'process.env.__NEXT_EXPORT_TRAILING_SLASH': JSON.stringify(config.experimental.exportTrailingSlash)
}), }),
!isServer && new ReactLoadablePlugin({ !isServer && new ReactLoadablePlugin({
......
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