diff --git a/packages/compiler-cli/src/metadata/bundle_index_host.ts b/packages/compiler-cli/src/metadata/bundle_index_host.ts index 17c5bda206..489c32c4db 100644 --- a/packages/compiler-cli/src/metadata/bundle_index_host.ts +++ b/packages/compiler-cli/src/metadata/bundle_index_host.ts @@ -71,8 +71,10 @@ export function createBundleIndexHost( indexFile = files[0]; } else { for (const f of files) { - // Assume the shortest file path called index.ts is the entry point - if (f.endsWith(path.sep + 'index.ts')) { + // Assume the shortest file path called index.ts is the entry point. Note that we + // need to use the posix path delimiter here because TypeScript internally only + // passes posix paths. + if (f.endsWith('/index.ts')) { if (!indexFile || indexFile.length > f.length) { indexFile = f; }