diff --git a/docs/api/options.md b/docs/api/options.md index 03168117..e8434929 100644 --- a/docs/api/options.md +++ b/docs/api/options.md @@ -8,7 +8,9 @@ General options of amp module | cdnBase | `https://cdn.ampproject.org/v0/` | Any String | A CDN Domain to load AMP elements scripts | | tags | `{}` | Object of tag options | Define new tags or modify current tags, for instance if you want to use `amp-mustache` version 0.1, tags value must be `{ 'amp-mustache': { version: '0.1' } }` | | origin | `` | Any String | Main domain of website. Using this AMP modules tries to add missing canonical link for pages. | -| mode | `hybrid` | `only\|hybrid\|false` | Default behaviour of amp module. (`only` all pages serve in AMP mode by default, `hybrid` pages serves in both normal and AMP mode, `false` pages does not serve AMP by default ) | +| mode | `hybrid` | `only\|hybrid\|false` | Default behaviour of amp module. (`only` all pages serve in AMP mode by default, `hybrid` +pages serves in both normal and AMP mode, `false` pages does not serve AMP by default ) | +| validator | `true` | `true\|false` | Validate generated HTML of AMP routes on development environment | | routeAliases | `auto` | `auto\|Array` | Allows to limit route aliases to only AMP pages. With `auto` the module will create aliases for every route. If your app uses AMP only on a few routes you can provide those routes into an Array. Routes are absolute, without '/amp' prefix, eg. `['/story', '/page2']` | diff --git a/lib/module.js b/lib/module.js index 1d9810d5..aa6ac0a8 100644 --- a/lib/module.js +++ b/lib/module.js @@ -19,6 +19,7 @@ module.exports = function (moduleOptions) { mode: 'hybrid', tags: {}, routeAliases: 'auto', + validator: true, ...this.options.amp, ...moduleOptions } @@ -28,7 +29,7 @@ module.exports = function (moduleOptions) { registerRendererHook.call(this, options) ensureMeta.call(this, options) - if (this.nuxt.options.dev) { + if (options.validator && this.nuxt.options.dev) { registerValidator.call(this, options) }