Skip to content

Commit

Permalink
Merge branch 'canary' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Feb 1, 2022
2 parents 6a3ca1c + a803638 commit de90dec
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
12 changes: 0 additions & 12 deletions packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -959,11 +959,6 @@ export default async function getBaseWebpackConfig(
},
}

const nonUserCondition = {
include: /node_modules/,
exclude: babelIncludeRegexes,
}

let webpackConfig: webpack.Configuration = {
parallelism: Number(process.env.NEXT_WEBPACK_PARALLELISM) || undefined,
externals: targetWeb
Expand Down Expand Up @@ -1256,13 +1251,6 @@ export default async function getBaseWebpackConfig(
},
],
},
{
...nonUserCondition,
// Make all non-user modules to be compiled in a single layer
// This avoids compiling them mutliple times and avoids module id changes
issuerLayer: 'middleware',
layer: '',
},
...(!config.images.disableStaticImages
? [
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions test/integration/middleware/hmr/pages/about/_middleware.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { NextResponse } from 'next/server'
import magicValue from 'shared-package'

export function middleware(request) {
if (magicValue !== 42) throw new Error('shared-package problem')
return NextResponse.rewrite(new URL('/about/a', request.url))
}
3 changes: 3 additions & 0 deletions test/integration/middleware/hmr/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import magicValue from 'shared-package'
if (magicValue !== 42) throw new Error('shared-package problem')

export default function Home() {
return (
<div>
Expand Down

0 comments on commit de90dec

Please sign in to comment.