diff --git a/.github/actions/next-stats-action/src/index.js b/.github/actions/next-stats-action/src/index.js
index 2bacd52b3501d..d7332d5edc893 100644
--- a/.github/actions/next-stats-action/src/index.js
+++ b/.github/actions/next-stats-action/src/index.js
@@ -1,3 +1,5 @@
+const path = require('path')
+const fs = require('fs-extra')
const exec = require('./util/exec')
const logger = require('./util/logger')
const runConfigs = require('./run')
@@ -25,6 +27,13 @@ if (!allowedActions.has(actionInfo.actionName) && !actionInfo.isRelease) {
;(async () => {
try {
+ if (await fs.pathExists(path.join(process.cwd(), 'SKIP_NEXT_STATS.txt'))) {
+ console.log(
+ 'SKIP_NEXT_STATS.txt file present, exiting stats generation..'
+ )
+ process.exit(0)
+ }
+
const { stdout: gitName } = await exec(
'git config user.name && git config user.email'
)
diff --git a/.github/workflows/build_test_deploy.yml b/.github/workflows/build_test_deploy.yml
index 3220cb97664f9..02cacac16397d 100644
--- a/.github/workflows/build_test_deploy.yml
+++ b/.github/workflows/build_test_deploy.yml
@@ -184,3 +184,14 @@ jobs:
key: ${{ github.sha }}
- run: ./publish-release.sh
+
+ prStats:
+ name: Release Stats
+ runs-on: ubuntu-latest
+ needs: [publishRelease]
+ steps:
+ - uses: actions/checkout@v2
+ - run: ./release-stats.sh
+ - uses: ./.github/actions/next-stats-action
+ env:
+ PR_STATS_COMMENT_TOKEN: ${{ secrets.PR_STATS_COMMENT_TOKEN }}
diff --git a/.github/workflows/release_stats.yml b/.github/workflows/release_stats.yml
deleted file mode 100644
index c734488bdc264..0000000000000
--- a/.github/workflows/release_stats.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-on: release
-
-name: Generate Release Stats
-
-jobs:
- prStats:
- name: Release Stats
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- - uses: ./.github/actions/next-stats-action
- env:
- PR_STATS_COMMENT_TOKEN: ${{ secrets.PR_STATS_COMMENT_TOKEN }}
diff --git a/docs/api-reference/next.config.js/exportPathMap.md b/docs/api-reference/next.config.js/exportPathMap.md
index bd6a7c28c090a..c28f201852b6c 100644
--- a/docs/api-reference/next.config.js/exportPathMap.md
+++ b/docs/api-reference/next.config.js/exportPathMap.md
@@ -13,6 +13,8 @@ description: Customize the pages that will be exported as HTML files when using
+`exportPathMap` allows you to specify a mapping of request paths to page destinations, to be used during export.
+
Let's start with an example, to create a custom `exportPathMap` for an app with the following pages:
- `pages/index.js`
diff --git a/docs/api-reference/next.config.js/rewrites.md b/docs/api-reference/next.config.js/rewrites.md
index c50bc290724e4..41ed98dd25303 100644
--- a/docs/api-reference/next.config.js/rewrites.md
+++ b/docs/api-reference/next.config.js/rewrites.md
@@ -17,6 +17,8 @@ Rewrites allow you to map an incoming request path to a different destination pa
Rewrites are only available on the Node.js environment and do not affect client-side routing.
+Rewrites are not able to override public files or routes in the pages directory as these have higher priority than rewrites. For example, if you have `pages/index.js` you are not able to rewrite `/` to another location unless you rename the `pages/index.js` file.
+
To use rewrites you can use the `rewrites` key in `next.config.js`:
```js
diff --git a/docs/basic-features/built-in-css-support.md b/docs/basic-features/built-in-css-support.md
index ae05f12481826..9933ca5378069 100644
--- a/docs/basic-features/built-in-css-support.md
+++ b/docs/basic-features/built-in-css-support.md
@@ -52,7 +52,7 @@ In production, all CSS files will be automatically concatenated into a single mi
### Import styles from `node_modules`
-Importing a CSS file from `node_modules` is permitted in anywhere your application.
+Since Next.js **9.5.4**, importing a CSS file from `node_modules` is permitted anywhere in your application.
For global stylesheets, like `bootstrap` or `nprogress`, you should import the file inside `pages/_app.js`.
For example:
diff --git a/docs/basic-features/static-file-serving.md b/docs/basic-features/static-file-serving.md
index 25cac8b8aa9e8..f7c52e48fa951 100644
--- a/docs/basic-features/static-file-serving.md
+++ b/docs/basic-features/static-file-serving.md
@@ -16,7 +16,7 @@ function MyImage() {
export default MyImage
```
-This folder is also useful for `robots.txt`, Google Site Verification, and any other static files (including `.html`)!
+This folder is also useful for `robots.txt`, `favicon.ico`, Google Site Verification, and any other static files (including `.html`)!
> **Note**: Don't name the `public` directory anything else. The name cannot be changed and is the only directory used to serve static assets.
diff --git a/docs/basic-features/typescript.md b/docs/basic-features/typescript.md
index 0e8cbfa668c9b..ec3b81b156bdb 100644
--- a/docs/basic-features/typescript.md
+++ b/docs/basic-features/typescript.md
@@ -41,7 +41,7 @@ You're now ready to start converting files from `.js` to `.tsx` and leveraging t
> A file named `next-env.d.ts` will be created in the root of your project. This file ensures Next.js types are picked up by the TypeScript compiler. **You cannot remove it**, however, you can edit it (but you don't need to).
-> Next.js `strict` mode is turned off by default. When you feel comfortable with TypeScript, it's recommended to turn it on in your `tsconfig.json`.
+> TypeScript `strict` mode is turned off by default. When you feel comfortable with TypeScript, it's recommended to turn it on in your `tsconfig.json`.
By default, Next.js will do type checking as part of `next build`. We recommend using code editor type checking during development.
diff --git a/examples/amp-first/README.md b/examples/amp-first/README.md
index 675c1d532b7b9..3c837e93d2edc 100644
--- a/examples/amp-first/README.md
+++ b/examples/amp-first/README.md
@@ -60,7 +60,7 @@ Things you need to do after installing the boilerplate:
```
- **amp-list & amp-mustache:** mustache templates conflict with JSX and it's template literals need to be escaped. A simple approach is to escape them via back ticks: `` src={`{{imageUrl}}`} ``.
-- **amp-script:** you can use [amp-script](https://amp.dev/documentation/components/amp-script/) to add custom JavaScript to your AMP pages. The boilerplate includes a helper [`components/amp/AmpScript.js`](components/amp/AmpScript.js) to simplify using amp-script. The helper also supports embedding inline scripts. Good to know: Next.js uses [AMP Optimizer](https://github.com/ampproject/amp-toolbox/tree/master/packages/optimizer) under the hood, which automatically adds the needed script hashes for [inline amp-scripts](https://amp.dev/documentation/components/amp-script/#load-javascript-from-a-local-element).
+- **amp-script:** you can use [amp-script](https://amp.dev/documentation/components/amp-script/) to add custom JavaScript to your AMP pages. The boilerplate includes a helper [`components/amp/AmpScript.js`](components/amp/AmpScript.js) to simplify using `amp-script`. The helper also supports embedding inline scripts. Good to know: Next.js uses [AMP Optimizer](https://github.com/ampproject/amp-toolbox/tree/master/packages/optimizer) under the hood, which automatically adds the needed script hashes for [inline amp-scripts](https://amp.dev/documentation/components/amp-script/#load-javascript-from-a-local-element).
## Deployment
diff --git a/examples/api-routes-rest/README.md b/examples/api-routes-rest/README.md
index 3f12cd4a67662..4bcb51a25655f 100644
--- a/examples/api-routes-rest/README.md
+++ b/examples/api-routes-rest/README.md
@@ -1,6 +1,6 @@
# API routes with REST
-Next.js ships with [API routes](https://github.com/vercel/next.js#api-routes), which provide an easy solution to build your own `API`. This example shows how it can be used to create your [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) api.
+Next.js ships with [API routes](https://github.com/vercel/next.js#api-routes), which provide an easy solution to build your own `API`. This example shows how it can be used to create your [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) `API`.
## Deploy your own
diff --git a/examples/blog-starter-typescript/README.md b/examples/blog-starter-typescript/README.md
index 95cee4f58b6f2..e8db3fc2498ce 100644
--- a/examples/blog-starter-typescript/README.md
+++ b/examples/blog-starter-typescript/README.md
@@ -2,11 +2,11 @@
This is the existing [blog-starter](https://github.com/vercel/next.js/tree/canary/examples/blog-starter) plus TypeScript.
-This example showcases Next.js's [Static Generation](https://nextjs.org/docs/basic-features/pages) feature using markdown files as the data source.
+This example showcases Next.js's [Static Generation](https://nextjs.org/docs/basic-features/pages) feature using Markdown files as the data source.
-The blog posts are stored in `/_posts` as markdown files with front matter support. Adding a new markdown file in there will create a new blog post.
+The blog posts are stored in `/_posts` as Markdown files with front matter support. Adding a new Markdown file in there will create a new blog post.
-To create the blog posts we use [`remark`](https://github.com/remarkjs/remark) and [`remark-html`](https://github.com/remarkjs/remark-html) to convert the markdown files into an HTML string, and then send it down as a prop to the page. The metadata of every post is handled by [`gray-matter`](https://github.com/jonschlinkert/gray-matter) and also sent in props to the page.
+To create the blog posts we use [`remark`](https://github.com/remarkjs/remark) and [`remark-html`](https://github.com/remarkjs/remark-html) to convert the Markdown files into an HTML string, and then send it down as a prop to the page. The metadata of every post is handled by [`gray-matter`](https://github.com/jonschlinkert/gray-matter) and also sent in props to the page.
## How to use
diff --git a/examples/blog-starter/README.md b/examples/blog-starter/README.md
index 7f6cf9b819120..01f09e6791718 100644
--- a/examples/blog-starter/README.md
+++ b/examples/blog-starter/README.md
@@ -1,10 +1,10 @@
# A statically generated blog example using Next.js and Markdown
-This example showcases Next.js's [Static Generation](https://nextjs.org/docs/basic-features/pages) feature using markdown files as the data source.
+This example showcases Next.js's [Static Generation](https://nextjs.org/docs/basic-features/pages) feature using Markdown files as the data source.
-The blog posts are stored in `/_posts` as markdown files with front matter support. Adding a new markdown file in there will create a new blog post.
+The blog posts are stored in `/_posts` as Markdown files with front matter support. Adding a new Markdown file in there will create a new blog post.
-To create the blog posts we use [`remark`](https://github.com/remarkjs/remark) and [`remark-html`](https://github.com/remarkjs/remark-html) to convert the markdown files into an HTML string, and then send it down as a prop to the page. The metadata of every post is handled by [`gray-matter`](https://github.com/jonschlinkert/gray-matter) and also sent in props to the page.
+To create the blog posts we use [`remark`](https://github.com/remarkjs/remark) and [`remark-html`](https://github.com/remarkjs/remark-html) to convert the Markdown files into an HTML string, and then send it down as a prop to the page. The metadata of every post is handled by [`gray-matter`](https://github.com/jonschlinkert/gray-matter) and also sent in props to the page.
## Demo
diff --git a/examples/environment-variables/pages/index.js b/examples/environment-variables/pages/index.js
index bda145075e664..848863d6b2b78 100644
--- a/examples/environment-variables/pages/index.js
+++ b/examples/environment-variables/pages/index.js
@@ -17,7 +17,7 @@ const IndexPage = () => (
In general only .env.local or .env are needed
for this, but the table also features the usage of{' '}
- .env.develoment and .env.production.
+ .env.development and .env.production.
@@ -75,7 +75,7 @@ const IndexPage = () => (
npm run dev
- Similarly, variables in .env.develoment won't be available
+ Similarly, variables in .env.development won't be available
if the app is running on production: