Skip to content

Commit ea763f7

Browse files
committed
add lib/common to the readme
1 parent 71e9e6b commit ea763f7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

README.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,16 @@ const hljs = require('./highlight.js');
256256
const highlightedCode = hljs.highlightAuto('<span>Hello World!</span>').value
257257
```
258258

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).
260260

261261
```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');
264269
hljs.registerLanguage('xml', require('highlight.js/lib/languages/xml'));
265270

266271
const highlightedCode = hljs.highlight('<span>Hello World!</span>', {language: 'xml'}).value

0 commit comments

Comments
 (0)