Unverified Commit 1e2c4c4c authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Ensure we dont attempt minifying middleware-chunks (#30147)

Follow-up to https://github.com/vercel/next.js/pull/30122 this ensures we don't minify the accompanying `middleware-chunks` either. 
parent 00fdb64d
...@@ -8,7 +8,6 @@ import { ...@@ -8,7 +8,6 @@ import {
import pLimit from 'p-limit' import pLimit from 'p-limit'
import { Worker } from 'jest-worker' import { Worker } from 'jest-worker'
import { spans } from '../../profiling-plugin' import { spans } from '../../profiling-plugin'
import { MIDDLEWARE_ROUTE } from '../../../../../lib/constants'
function getEcmaVersion(environment) { function getEcmaVersion(environment) {
// ES 6th // ES 6th
...@@ -99,7 +98,7 @@ export class TerserPlugin { ...@@ -99,7 +98,7 @@ export class TerserPlugin {
// don't minify _middleware as it can break in some cases // don't minify _middleware as it can break in some cases
// and doesn't provide too much of a benefit as it's server-side // and doesn't provide too much of a benefit as it's server-side
if (MIDDLEWARE_ROUTE.test(name.replace(/\.js$/, ''))) { if (name.match(/(middleware-chunks|_middleware\.js$)/)) {
return false return false
} }
......
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