Skip to content

Commit

Permalink
produce source maps for middlewares
Browse files Browse the repository at this point in the history
  • Loading branch information
Schniz committed Feb 16, 2022
1 parent 7e93a89 commit 4758d92
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/next/build/webpack-config.ts
Expand Up @@ -1277,6 +1277,16 @@ export default async function getBaseWebpackConfig(
].filter(Boolean),
},
plugins: [
// Produce source maps for middlewares
new webpack.SourceMapDevToolPlugin({
filename: '[file].map',
include: [
// Middlewares are the only ones who have `server/pages/[name]` as their filename
/^server\/pages\//,
// All middleware chunks
/^server\/middleware-chunks\//,
],
}),
hasReactRefresh && new ReactRefreshWebpackPlugin(webpack),
// Makes sure `Buffer` and `process` are polyfilled in client and flight bundles (same behavior as webpack 4)
targetWeb &&
Expand Down

0 comments on commit 4758d92

Please sign in to comment.