Skip to content

(doc): Fix usage of highlight.js/lib/common #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2021
Merged

(doc): Fix usage of highlight.js/lib/common #20

merged 1 commit into from
Oct 7, 2021

Conversation

Trinovantes
Copy link
Contributor

Modern bundlers will optimize out unused imported names. Importing the module directly will indicate that it is a side effect and should not be optimized out.

Fix #18

@joshgoebel
Copy link
Member

joshgoebel commented Oct 7, 2021

Ok, but how do I get the hljs object if I wish to customize it? Or I guess you'd just import it and reference it and that magically fixes it since now it's not optimized out? LOL

Feels like we need to explain both cases?

@Trinovantes
Copy link
Contributor Author

Good point, I'll update the PR

Modern bundlers will optimize out unused imported names. Importing the module directly will indicate that it is a side effect and should not be optimized out.

Fix #18
@joshgoebel joshgoebel merged commit 02c4757 into highlightjs:main Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Syntax highlight does not work properly
2 participants