Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kolirt/vite-plugin-robots
🤖 Vite plugin for generating robots.txt for production and development builds
https://github.com/kolirt/vite-plugin-robots
robots vite vite-robots
Last synced: 1 day ago
JSON representation
🤖 Vite plugin for generating robots.txt for production and development builds
- Host: GitHub
- URL: https://github.com/kolirt/vite-plugin-robots
- Owner: kolirt
- License: mit
- Created: 2024-03-17T21:40:31.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-05-15T19:24:33.000Z (6 months ago)
- Last Synced: 2024-10-31T19:47:07.290Z (8 days ago)
- Topics: robots, vite, vite-robots
- Language: TypeScript
- Homepage:
- Size: 107 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-vite - vite-plugin-robots - Generating `robots.txt`. (Plugins / Framework-agnostic Plugins)
- awesome-vue-3 - vite-plugin-robots - Plugin for Vite to generating robots.txt for production and development builds. (Packages)
- awesome-vite - vite-plugin-robots - Generating `robots.txt`. (Plugins / Framework-agnostic Plugins)
README
## Introduction
The package allows you to customize different `robots.txt` for `production` mode and `development` mode.
```bash
vite build
``````bash
vite build --mode=development
```## Installation
Use yarn or npm to install the package `vite-plugin-robots`.
```bash
npm install -D vite-plugin-robotsyarn add --dev vite-plugin-robots
```## Setup
```ts
import { robots } from 'vite-plugin-robots'
import { defineConfig } from 'vite'export default defineConfig({
plugins: [
robots({
/* pass your config */
})
]
})
```## Configuration robot.txt
The package copies the corresponding robots.txt according to the build mode.
```
.robots.[mode].txt # only loaded in specified mode
.robots.[mode].txt.local # only loaded in specified mode, ignored by git
```Create `.robots.production.txt` and `.robots.development.txt` in the project root and the package will start using them.
## License
[MIT](./LICENSE)# Other packages
Check out my other projects on my [GitHub profile](https://github.com/kolirt).