Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AMP validation docs #13525

Merged
merged 3 commits into from May 29, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/advanced-features/amp-support/amp-validation.md
Expand Up @@ -7,3 +7,27 @@ description: AMP pages are automatically validated by Next.js during development
AMP pages are automatically validated with [amphtml-validator](https://www.npmjs.com/package/amphtml-validator) during development. Errors and warnings will appear in the terminal where you started Next.js.

Pages are also validated during [Static HTML export](/docs/advanced-features/static-html-export.md) and any warnings / errors will be printed to the terminal. Any AMP errors will cause the export to exit with status code `1` because the export is not valid AMP.

### Custom Validators

You can set up custom AMP validator in `next.config.js` as shown below:

```jsx
module.exports = {
amp: {
validator: './custom_validator.js',
},
}
```

### Skip AMP Validation

To turn off AMP validation add the following code to `next.config.js`

```jsx
experimental: {
amp: {
skipValidation: true
}
}
```