Unverified Commit 45c36e66 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub
parent c5896f28
......@@ -9,6 +9,7 @@ description: Learn about the Next.js Compiler, written in Rust, which transforms
| Version | Changes |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `v13.0.0` | SWC Minifier enabled by default. |
| `v12.3.0` | SWC Minifier [stable](https://nextjs.org/blog/next-12-3#swc-minifier-stable). |
| `v12.2.0` | [SWC Plugins](#swc-plugins-Experimental) experimental support added. |
| `v12.1.0` | Added support for Styled Components, Jest, Relay, Remove React Properties, Legacy Decorators, Remove Console, and jsxImportSource. |
......@@ -241,18 +242,18 @@ Only `importMap` in `@emotion/babel-plugin` is not supported for now.
### Minification
You can opt-in to using the Next.js compiler for minification. This is 7x faster than Terser.
Next.js' swc compiler is used for minification by default since v13. This is 7x faster than Terser.
If Terser is still needed for any reason this can be configured.
```js
// next.config.js
module.exports = {
swcMinify: true,
swcMinify: false,
}
```
If you have feedback about `swcMinify`, please share it on the [feedback discussion](https://github.com/vercel/next.js/discussions/30237).
## Experimental Features
### Minifier debug options
......@@ -271,7 +272,6 @@ module.exports = {
},
},
},
swcMinify: true,
}
```
......
......@@ -547,7 +547,7 @@ export const defaultConfig: NextConfig = {
},
outputFileTracing: true,
staticPageGenerationTimeout: 60,
swcMinify: false,
swcMinify: true,
output: !!process.env.NEXT_PRIVATE_STANDALONE ? 'standalone' : undefined,
experimental: {
optimisticClientCache: true,
......
......@@ -471,13 +471,6 @@ function assignDefaults(userConfig: { [key: string]: any }) {
)
}
if (result.experimental && 'swcMinify' in (result.experimental as any)) {
Log.warn(
`\`swcMinify\` has been moved out of \`experimental\`. Please update your ${configFileName} file accordingly.`
)
result.swcMinify = (result.experimental as any).swcMinify
}
if (result.experimental && 'relay' in (result.experimental as any)) {
Log.warn(
`\`relay\` has been moved out of \`experimental\` and into \`compiler\`. Please update your ${configFileName} file accordingly.`
......
......@@ -129,33 +129,5 @@ module.exports = {
// numRequests: 2500,
// },
},
{
title: 'Default Build with SWC minify',
// renames to apply to make file names deterministic
renames,
configFiles: [
{
path: 'next.config.js',
content: `
module.exports = {
experimental: {
appDir: true,
// remove after next stable relase (current v12.3.1)
serverComponents: true
},
swcMinify: true,
generateBuildId: () => 'BUILD_ID'
}
`,
},
],
filesToTrack: clientGlobs,
// will be output to fetched-pages/${pathname}.html
pagesToFetch: [
'http://localhost:$PORT/',
'http://localhost:$PORT/link',
'http://localhost:$PORT/withRouter',
],
},
],
}
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