rsnext/docs/advanced-features/amp-support/amp-validation.md
Pavel Korotenko ff2a03f30a
Update AMP validation docs (#13525)
Updates docs for AMP validation with usage examples for custom validators added in #9191 and `skipValidation` mode added in #10705
2020-05-29 18:05:51 +00:00

965 B

description
AMP pages are automatically validated by Next.js during development and on build. Learn more about it here.

AMP Validation

AMP pages are automatically validated with 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 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:

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

Skip AMP Validation

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

experimental: {
  amp: {
    skipValidation: true
  }
}