import { NgModule } from '@angular/core' ; import { CommonModule } from '@angular/common' ; import { TooltipDirective } from './tooltip.directive' ; import { HighlightModule , HIGHLIGHT_OPTIONS } from 'ngx-highlightjs' ; import { TranslateModule } from '@ngx-translate/core' ; @ NgModule ( { declarations : [ TooltipDirective ] , exports : [ TooltipDirective , CommonModule , HighlightModule , TranslateModule ] , providers : [ { provide : HIGHLIGHT_OPTIONS , useValue : { languages : getHighlightLanguages ( ) } } ] , } ) export class SharedModule { } /**
 * Import specific languages to avoid importing everything
 * The following will lazy load highlight.js core script (~9.6KB) + the selected languages bundle (each lang. ~1kb)
 */ export function getHighlightLanguages ( ) { return { typescript : ( ) => import ( 'highlight.js/lib/languages/javascript' ) } ; }