Skip to content

Commit ddd0a7c

Browse files
committed
explain the magic
1 parent 17ac21c commit ddd0a7c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,12 @@ import vuePlugin from "@highlightjs/vue-plugin";
3737
hljs.registerLanguage('javascript', javascript);
3838

3939
Vue.use(vuePlugin());
40-
```
40+
```
41+
42+
Note: This plugin imports `lib/core` internally (but no languages). Thanks to the magic of ES6 modules you can import Highlight.js anywhere you need in order to register languages or configure the library. Or can also simply use the "common" languages (as of v11):
43+
44+
```js
45+
import hljs from 'highlight.js/lib/common';
46+
import vuePlugin from "@highlightjs/vue-plugin";
47+
Vue.use(vuePlugin());
48+
```

0 commit comments

Comments
 (0)