import { readdirSync } from 'fs'; import { TargetOptions } from '@angular-builders/custom-webpack'; export default (targetOptions: TargetOptions, indexHtml: string) => { const i = indexHtml.indexOf(''); const bundlePath = '../../dist/packages/shell/bundle'; const files = readdirSync(bundlePath); let insert = ''; for (const file of files) { if (file.indexOf('msftsme.') === 0 || file.indexOf('vendor.') === 0) { insert += ``; } } return `${indexHtml.slice(0, i)} ${insert} ${indexHtml.slice(i)}`; };