1.0.4 • Published 3 years ago
env-robotstxt v1.0.4
Feature
- Set
env variableto generaterobots.txtfile - Generate
Disallow: /by default (without env variable) - Allow generate in to different folder
- Easy to config robots.txt if you use
git(different branch different robots content) - For all static website projects, like html, vue, react, angular, php, etc.
Install
npm install env-robotstxt
# or
yarn add env-robotstxtConfig
Add the robot (or your preferred command) command in scripts object:
"scripts": {
"robot": "npx env-robotstxt" // default
},"scripts": {
"robot": "npx env-robotstxt dist" // generate into `dist` folder
},then set up the env variable ENV_ROBOTS_CONTENT:
ENV_ROBOTS_CONTENT="User-agent: *\nDisallow: \nSitemap: https://domain.name/sitemap.xml"Run
npm run robot
or
yarn robot