-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
index.js
32 lines (31 loc) · 852 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
/**
* rehype plugin to concatenate `<script>`s together.
*
* ## What is this?
*
* This package is a plugin that can improve performance by merging multiple
* JS `<script>` elements together.
* This plugin can be dangerous if JavaScript is invalid or values are expected
* to be `undefined` in one script but not in another.
*
* ## When should I use this?
*
* You can use this plugin when you are certain that your JavaScript is
* and you want to improve the size of HTML.
*
* ## API
*
* ### `unified().use(rehypeConcatJavaScript)`
*
* Concatenate JS `<script>` elements together.
*
* ###### Returns
*
* Transform ([`Transformer`](https://github.com/unifiedjs/unified#transformer)).
*
* @example
* {}
* <script>function foo() {}</script>
* <script>function bar() {}</script>
*/
export {default} from './lib/index.js'