Unverified Commit 0ac0b3f1 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Skip minifying middleware (#30122)

This skips minifying middleware as it can cause issues in some cases like the below error and also isn't necessary to be minified as we don't currently minify other server pages. 

```
TypeError: (intermediate value)(intermediate value)(intermediate value)(...) is not a function
```
parent ecf2ee9c
......@@ -8,6 +8,7 @@ import {
import pLimit from 'p-limit'
import { Worker } from 'jest-worker'
import { spans } from '../../profiling-plugin'
import { MIDDLEWARE_ROUTE } from '../../../../../lib/constants'
function getEcmaVersion(environment) {
// ES 6th
......@@ -96,6 +97,12 @@ export class TerserPlugin {
return false
}
// 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
if (MIDDLEWARE_ROUTE.test(name.replace(/\.js$/, ''))) {
return false
}
const { info } = res
// Skip double minimize assets from child compilation
......
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