Unverified Commit 48140d5b authored by Joe Haddad's avatar Joe Haddad Committed by GitHub

Disable Comment Extraction (#12496)

parent f0248140
......@@ -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,
......
/*! 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', () => {
......
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