-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathindex.js
34 lines (33 loc) · 973 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* rehype plugin to prevent a network request to the favicon when there
* is none.
*
* ## What is this?
*
* This package is a plugin that inserts an empty favicon image, when there is
* none referenced, to prevent a network request.
*
* ## When should I use this?
*
* You can use this plugin when you don’t have a `favicon.ico` at the root of
* your server, and want to prevent browsers sending out a network request to
* find it.
*
* This plugin increases the size of the HTML, but prevents a round trip to
* the server by inserting an empty favicon.
*
* ## API
*
* ### `unified().use(rehypePreventFaviconRequest)`
*
* Prevent a network request to the favicon when there is none.
*
* ###### Returns
*
* Transform ([`Transformer`](https://github.com/unifiedjs/unified#transformer)).
*
* @example
* {"processor": {"fragment": false}}
* <!doctype html><html><head></head><body></body></html>
*/
export {default} from './lib/index.js'