ngx-highlightjs
ngx-highlightjs copied to clipboard
Move HIGHLIGHT_OPTIONS to sub-entrypoint
The HIGHLIGHT_OPTIONS
provider must always be provided at the root. Because of this, the entire ngx-highlightjs library is bundled into the main bundle, even when it's only being used on a page
This PR moves the provider to a seperate entrypoint, causing the rest of the library to be tree-shakable.
It should be tree shakable the way it is! in which environment you run your test?
Thanks. I'm not using the HighlightModule
on the AppComponent
but on a page that's lazy-loaded. However, we must configure the HIGHLIGHT_OPTIONS
at root level. Because everything resides in the same library entrypoint, it's all being bundled together.
Here's the place where I use the HighlightModule
. This component is being used on this page (lazy-loaded). The HIGHLIGHT_OPTIONS
is provided here, so the main entrypoint is bundled in the main-bundle
Please try latest version 11