Package Exports
- @nuxtjs/robots
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@nuxtjs/robots) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@nuxtjs/robots
A NuxtJS module thats inject a middleware to generate a robots.txt file
Setup
- Add
@nuxtjs/robotsdependency to your project
yarn add @nuxtjs/robots # or npm install @nuxtjs/robots- Add
@nuxtjs/robotsto themodulessection ofnuxt.config.js
{
modules: [
// Simple usage
'@nuxtjs/robots',
// With options
['@nuxtjs/robots', { /* module options */ }]
]
}Using top level options
{
modules: [
'@nuxtjs/robots'
],
robots: {
/* module options */
}
}Options
The module option parameter can be:
Object
{
robots: {
UserAgent: '*',
Disallow: '/'
}
}Array
{
robots: [
{
UserAgent: 'Googlebot',
Disallow: () => '/users' // accepts function
}
]
}Function
{
robots: () => {
return {
UserAgent: '*',
Disallow: '/'
}
}
}Will generate a /robots.txt
UserAgent: Googlebot
Disallow: /users
UserAgent: Bingbot
Disallow: /adminLicense
Thanks William DA SILVA for making this module
Copyright (c) - Nuxt Community