Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Last synced: about 2 months ago
JSON representation

🤖 Vite plugin for generating robots.txt for production and development builds

Awesome Lists containing this project

README

        


vite logo

Vite Robots.txt


Plugin for Vite to generating robots.txt for production and development builds.



node-current

npm peer dependency version

npm bundle size


npm-version

licence



Buy Me A Coffee

## 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-robots

yarn 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).