UNPKG

1.96 kBMarkdownView Raw
1# robotstxt-webpack-plugin
2
3[![NPM version](https://img.shields.io/npm/v/robotstxt-webpack-plugin.svg)](https://www.npmjs.org/package/robotstxt-webpack-plugin)
4[![Travis Build Status](https://img.shields.io/travis/itgalaxy/robotstxt-webpack-plugin/master.svg?label=build)](https://travis-ci.org/itgalaxy/robotstxt-webpack-plugin)
5[![dependencies Status](https://david-dm.org/itgalaxy/robotstxt-webpack-plugin/status.svg)](https://david-dm.org/itgalaxy/robotstxt-webpack-plugin)
6[![devDependencies Status](https://david-dm.org/itgalaxy/robotstxt-webpack-plugin/dev-status.svg)](https://david-dm.org/itgalaxy/robotstxt-webpack-plugin?type=dev)
7[![Greenkeeper badge](https://badges.greenkeeper.io/itgalaxy/robotstxt-webpack-plugin.svg)](https://greenkeeper.io)
8
9Webpack plugin for [generate-robotstxt](https://github.com/itgalaxy/generate-robotstxt/) package.
10Generating `robots.txt` using webpack.
11Why your need [robots.txt](https://support.google.com/webmasters/answer/6062608?hl=en)?
12
13## Install
14
15```shell
16npm install --save-dev robotstxt-webpack-plugin
17```
18
19## Usage
20
21```js
22const RobotstxtPlugin = require('robotstxt-webpack-plugin').default;
23
24const options = {}; // see options below
25
26module.exports = {
27 plugins: [
28 new RobotstxtPlugin(options)
29 ]
30}
31```
32
33Or
34
35```js
36import RobotstxtPlugin from 'robotstxt-webpack-plugin';
37
38const options = {}; // see options below
39
40export default {
41 plugins: [
42 new RobotstxtPlugin(options)
43 ]
44};
45```
46
47## Options
48
49- `General options` - see [generate-robotstxt](https://github.com/itgalaxy/generate-robotstxt) options.
50- `filePath` - (optional) path for robots.txt (should be contain full path include `robots.txt` file name, example - `path/to/robots.txt`).
51
52## Related
53
54- [generate-robotstxt](https://github.com/itgalaxy/generate-robotstxt) - api for this package.
55
56## Contribution
57
58Feel free to push your code if you agree with publishing under the MIT license.
59
60## [Changelog](CHANGELOG.md)
61
62## [License](LICENSE)