Disable Comment Extraction (#12496)
This commit is contained in:
parent
f024814057
commit
48140d5bb7
3 changed files with 11 additions and 0 deletions
|
@ -640,6 +640,7 @@ export default async function getBaseWebpackConfig(
|
|||
minimizer: [
|
||||
// Minify JavaScript
|
||||
new TerserPlugin({
|
||||
extractComments: false,
|
||||
cache: path.join(distDir, 'cache', 'next-minifier'),
|
||||
parallel: config.experimental.cpus || true,
|
||||
terserOptions,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/*! DO NOT EXTRACT ME */
|
||||
export default function() {
|
||||
return <div />
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import 'flat-map-polyfill'
|
|||
import { remove } from 'fs-extra'
|
||||
import { nextBuild } from 'next-test-utils'
|
||||
import { join } from 'path'
|
||||
import { recursiveReadDir } from 'next/dist/lib/recursive-readdir'
|
||||
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 2
|
||||
|
||||
|
@ -34,6 +35,14 @@ describe('Build Output', () => {
|
|||
|
||||
expect(stdout).toContain('○ /')
|
||||
})
|
||||
|
||||
it('should not emit extracted comments', async () => {
|
||||
const files = await recursiveReadDir(
|
||||
join(appDir, '.next'),
|
||||
/\.txt|\.LICENSE\./
|
||||
)
|
||||
expect(files).toEqual([])
|
||||
})
|
||||
})
|
||||
|
||||
describe('Custom App Output', () => {
|
||||
|
|
Loading…
Reference in a new issue