forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move swcMinify out of experimental (vercel#29810)
- Loading branch information
1 parent
b31b492
commit bc3ab3c
Showing
106 changed files
with
2,586 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# SWC minify enabled | ||
|
||
#### Why This Message Occurred | ||
|
||
The application has enabled `swcMinify` in `next.config.js`. By opting in minification will happen using the [SWC](https://swc.rs) minifier instead of Terser. This new minifier is 7x faster than Terser with comparable output. We're actively working on optimizing the output size and minification speed further. | ||
|
||
If you have feedback about the minification, please provide it on [the feedback thread](https://github.com/vercel/next.js/discussions/30237). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["next/babel"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["next/babel"] | ||
} |
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
test/integration/production-swcminify/components/dynamic-css/many-imports/with-css-1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import styles from './with-css-1.module.css' | ||
|
||
export default () => <p className={styles.content}>With CSS 1</p> |
3 changes: 3 additions & 0 deletions
3
...ntegration/production-swcminify/components/dynamic-css/many-imports/with-css-1.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.content { | ||
color: inherit; | ||
} |
3 changes: 3 additions & 0 deletions
3
test/integration/production-swcminify/components/dynamic-css/many-imports/with-css-2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import styles from './with-css-2.module.css' | ||
|
||
export default () => <p className={styles.content}>With CSS 2</p> |
3 changes: 3 additions & 0 deletions
3
...ntegration/production-swcminify/components/dynamic-css/many-imports/with-css-2.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.content { | ||
color: inherit; | ||
} |
3 changes: 3 additions & 0 deletions
3
test/integration/production-swcminify/components/dynamic-css/many-imports/with-css-3.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import styles from './with-css-3.module.css' | ||
|
||
export default () => <p className={styles.content}>With CSS 3</p> |
3 changes: 3 additions & 0 deletions
3
...ntegration/production-swcminify/components/dynamic-css/many-imports/with-css-3.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.content { | ||
color: inherit; | ||
} |
3 changes: 3 additions & 0 deletions
3
...ntegration/production-swcminify/components/dynamic-css/many-modules/with-css-2.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.text { | ||
color: red; | ||
} |
8 changes: 8 additions & 0 deletions
8
test/integration/production-swcminify/components/dynamic-css/many-modules/with-css.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import styles from './with-css.module.css' | ||
import styles2 from './with-css-2.module.css' | ||
|
||
export default () => ( | ||
<div className={styles.content}> | ||
<p className={styles2.text}>With CSS</p> | ||
</div> | ||
) |
3 changes: 3 additions & 0 deletions
3
.../integration/production-swcminify/components/dynamic-css/many-modules/with-css.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.content { | ||
color: inherit; | ||
} |
3 changes: 3 additions & 0 deletions
3
test/integration/production-swcminify/components/dynamic-css/nested/Nested.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import styles2 from './with-css-2.module.css' | ||
|
||
export default () => <p className={styles2.text}>With CSS</p> |
3 changes: 3 additions & 0 deletions
3
test/integration/production-swcminify/components/dynamic-css/nested/with-css-2.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.text { | ||
color: red; | ||
} |
8 changes: 8 additions & 0 deletions
8
test/integration/production-swcminify/components/dynamic-css/nested/with-css.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import styles from './with-css.module.css' | ||
import Nested from './Nested' | ||
|
||
export default () => ( | ||
<div className={styles.content}> | ||
<Nested /> | ||
</div> | ||
) |
3 changes: 3 additions & 0 deletions
3
test/integration/production-swcminify/components/dynamic-css/nested/with-css.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.content { | ||
color: inherit; | ||
} |
1 change: 1 addition & 0 deletions
1
test/integration/production-swcminify/components/dynamic-css/no-css.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default () => <p>Without CSS</p> |
8 changes: 8 additions & 0 deletions
8
test/integration/production-swcminify/components/dynamic-css/shared-css-module/with-css-2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import styles from './with-css-2.module.css' | ||
import stylesShared from './with-css-shared.module.css' | ||
|
||
export default () => ( | ||
<div className={styles.content}> | ||
<p className={stylesShared.test}>With CSS</p> | ||
</div> | ||
) |
3 changes: 3 additions & 0 deletions
3
...ation/production-swcminify/components/dynamic-css/shared-css-module/with-css-2.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.content { | ||
color: inherit; | ||
} |
3 changes: 3 additions & 0 deletions
3
.../production-swcminify/components/dynamic-css/shared-css-module/with-css-shared.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.text { | ||
color: red; | ||
} |
8 changes: 8 additions & 0 deletions
8
test/integration/production-swcminify/components/dynamic-css/shared-css-module/with-css.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import styles from './with-css.module.css' | ||
import stylesShared from './with-css-shared.module.css' | ||
|
||
export default () => ( | ||
<div className={styles.content}> | ||
<p className={stylesShared.test}>With CSS</p> | ||
</div> | ||
) |
3 changes: 3 additions & 0 deletions
3
...gration/production-swcminify/components/dynamic-css/shared-css-module/with-css.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.content { | ||
color: inherit; | ||
} |
7 changes: 7 additions & 0 deletions
7
test/integration/production-swcminify/components/dynamic-css/with-css.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import styles from './with-css.module.css' | ||
|
||
export default () => ( | ||
<p id="with-css" className={styles.content}> | ||
With CSS | ||
</p> | ||
) |
4 changes: 4 additions & 0 deletions
4
test/integration/production-swcminify/components/dynamic-css/with-css.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.content { | ||
color: inherit; | ||
display: flex; | ||
} |
13 changes: 13 additions & 0 deletions
13
test/integration/production-swcminify/components/hello-context.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
|
||
export default class extends React.Component { | ||
static contextTypes = { | ||
data: PropTypes.object, | ||
} | ||
|
||
render() { | ||
const { data } = this.context | ||
return <div>{data.title}</div> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default () => <p>Hello World 1</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default () => <p>Hello World 2</p> |
19 changes: 19 additions & 0 deletions
19
test/integration/production-swcminify/components/logo/dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
test/integration/production-swcminify/components/logo/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import styles from './logo.module.css' | ||
|
||
export default function Logo() { | ||
return <div className={styles.logo}></div> | ||
} |
3 changes: 3 additions & 0 deletions
3
test/integration/production-swcminify/components/logo/logo.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.logo { | ||
background-image: url(dark.svg); | ||
} |
17 changes: 17 additions & 0 deletions
17
test/integration/production-swcminify/components/welcome.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react' | ||
|
||
export default class Welcome extends React.Component { | ||
state = { name: null } | ||
|
||
componentDidMount() { | ||
const { name } = this.props | ||
this.setState({ name }) | ||
} | ||
|
||
render() { | ||
const { name } = this.state | ||
if (!name) return null | ||
|
||
return <p>Welcome, {name}</p> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"version": "cool-version" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// intervals/open connections shouldn't block build from exiting | ||
setInterval(() => {}, 250) | ||
|
||
module.exports = { | ||
swcMinify: true, | ||
experimental: { | ||
outputFileTracing: true, | ||
}, | ||
onDemandEntries: { | ||
// Make sure entries are not getting disposed. | ||
maxInactiveAge: 1000 * 60 * 60, | ||
}, | ||
rewrites() { | ||
// add a rewrite so the code isn't dead-code eliminated | ||
return [ | ||
{ | ||
source: '/some-rewrite', | ||
destination: '/', | ||
}, | ||
] | ||
}, | ||
redirects() { | ||
return [ | ||
{ | ||
source: '/redirect/me/to-about/:lang', | ||
destination: '/:lang/about', | ||
permanent: false, | ||
}, | ||
{ | ||
source: '/nonexistent', | ||
destination: '/about', | ||
permanent: false, | ||
}, | ||
{ | ||
source: '/shadowed-page', | ||
destination: '/about', | ||
permanent: false, | ||
}, | ||
{ | ||
source: '/redirect-query-test/:path', | ||
destination: '/about?foo=:path', | ||
permanent: false, | ||
}, | ||
] | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default () => <div className="about-page">About Page</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export default () => 'hi' | ||
export const config = { amp: 'hybrid' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export default () => 'hi' | ||
export const config = { amp: true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Link from 'next/link' | ||
|
||
export default () => ( | ||
<div> | ||
<Link href="/"> | ||
<a>Index Page</a> | ||
</Link> | ||
<p>Another</p> | ||
</div> | ||
) |
3 changes: 3 additions & 0 deletions
3
test/integration/production-swcminify/pages/api/[post]/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default ({ query }, res) => { | ||
res.status(200).json(query) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default (req, res) => { | ||
res.end('API hello works') | ||
} |
Oops, something went wrong.