-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathindex.js
31 lines (30 loc) · 834 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
/**
* rehype plugin to remove the contents of external JavaScript `<script>`s.
*
* ## What is this?
*
* This package is a plugin that removes the contents of JavaScript `<script>`s
* that also have an `src` attribute.
* Scripts are supposed to be either external (with `src`) or internal (with
* code in them), and both is nonsensical.
*
* ## When should I use this?
*
* You can use this plugin when you want to improve the transfer size of HTML
* documents.
*
* ## API
*
* ### `unified().use(rehypeRemoveExternalScriptContent)`
*
* Remove the contents of external JavaScript `<script>`s.
*
* ###### Returns
*
* Transform ([`Transformer`](https://github.com/unifiedjs/unified#transformer)).
*
* @example
* {}
* <script src="index.js">console.log(1);</script>
*/
export {default} from './lib/index.js'