File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -256,11 +256,16 @@ const hljs = require('./highlight.js');
256
256
const highlightedCode = hljs .highlightAuto (' <span>Hello World!</span>' ).value
257
257
```
258
258
259
- For a smaller footprint, load only the languages you need .
259
+ For a smaller footprint, load our common subset of languages (the same set used for our default web build) .
260
260
261
261
``` js
262
- const hljs = require (' highlight.js/lib/core' ); // require only the core library
263
- // separately require languages
262
+ const hljs = require (' highlight.js/lib/common' );
263
+ ```
264
+
265
+ For the smallest footprint, load only the languages you need:
266
+
267
+ ``` js
268
+ const hljs = require (' highlight.js/lib/core' );
264
269
hljs .registerLanguage (' xml' , require (' highlight.js/lib/languages/xml' ));
265
270
266
271
const highlightedCode = hljs .highlight (' <span>Hello World!</span>' , {language: ' xml' }).value
You can’t perform that action at this time.
0 commit comments