Skip to content

Commit

Permalink
Make it under an experimental flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Schniz committed Feb 24, 2022
1 parent ea1dccd commit dafe3ea
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/next/build/webpack-config.ts
Expand Up @@ -1274,6 +1274,7 @@ export default async function getBaseWebpackConfig(
},
plugins: [
...getMiddlewareSourceMapPlugins({
isConfigured: !!config.experimental.middlewareSourceMaps,
isProductionBrowserSourceMapsOn: config.productionBrowserSourceMaps,
}),
hasReactRefresh && new ReactRefreshWebpackPlugin(webpack),
Expand Down
Expand Up @@ -8,9 +8,10 @@ import type { webpack5 } from 'next/dist/compiled/webpack/webpack'
* are emitted.
*/
export const getMiddlewareSourceMapPlugins = (params: {
isConfigured: boolean
isProductionBrowserSourceMapsOn: boolean
}) => {
if (params.isProductionBrowserSourceMapsOn) {
if (!params.isConfigured || params.isProductionBrowserSourceMapsOn) {
return []
}

Expand Down
1 change: 1 addition & 0 deletions packages/next/server/config-shared.ts
Expand Up @@ -106,6 +106,7 @@ export interface ExperimentalConfig {
urlImports?: NonNullable<webpack5.Configuration['experiments']>['buildHttp']
outputFileTracingRoot?: string
outputStandalone?: boolean
middlewareSourceMaps?: boolean
}

/**
Expand Down

0 comments on commit dafe3ea

Please sign in to comment.