Unverified Commit 9da8d656 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Add minify debug env var to investigate minifier bugs (#31417)

parent 0afc1d2b
......@@ -47,13 +47,14 @@ function buildError(error, file) {
return new Error(`${file} from Terser\n${error.message}`)
}
const debugMinify = process.env.NEXT_DEBUG_MINIFY
export class TerserPlugin {
constructor(options = {}) {
const { cacheDir, terserOptions = {}, parallel, swcMinify } = options
const { terserOptions = {}, parallel, swcMinify } = options
this.options = {
swcMinify,
cacheDir,
parallel,
terserOptions,
}
......@@ -128,6 +129,18 @@ export class TerserPlugin {
numberOfAssetsForMinify += 1
}
if (debugMinify && debugMinify === '1') {
console.dir(
{
name,
source: source.source().toString(),
},
{
breakLength: Infinity,
maxStringLength: Infinity,
}
)
}
return { name, info, inputSource: source, output, eTag }
})
)
......
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