Skip to content

Commit c55f68d

Browse files
committed
fix(@angular/build): pass load cache to compiler plugin and escape extension regex in polyfills
Ensure sourceFileCache.loadResultCache is forwarded when creating compiler plugin options for browser polyfills, escape the file extension regex in entryFileToWorkspaceRelative, and add a missing semicolon in SSR bundle options.
1 parent 3254591 commit c55f68d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/angular/build/src/tools/esbuild/application-code-bundle.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ export function createBrowserPolyfillBundleOptions(
141141
buildOptions.plugins ??= [];
142142
const pluginOptions = createCompilerPluginOptions(
143143
options,
144-
145144
sourceFileCache,
145+
sourceFileCache.loadResultCache,
146146
);
147147
buildOptions.plugins.push(
148148
createCompilerPlugin(
@@ -501,7 +501,7 @@ export function createSsrEntryCodeBundleOptions(
501501
// The below is needed to avoid
502502
// `Import "default" will always be undefined because there is no matching export` warning when no default is present.
503503
`const defaultExportName = 'default';`,
504-
`export default server[defaultExportName]`,
504+
`export default server[defaultExportName];`,
505505

506506
// Add @angular/ssr exports
507507
`export { AngularAppEngine } from '@angular/ssr';`,
@@ -764,7 +764,7 @@ function getEsBuildCommonPolyfillsOptions(
764764
}
765765

766766
function entryFileToWorkspaceRelative(workspaceRoot: string, entryFile: string): string {
767-
return './' + toPosixPath(relative(workspaceRoot, entryFile).replace(/.[mc]?ts$/, ''));
767+
return './' + toPosixPath(relative(workspaceRoot, entryFile).replace(/\.[mc]?ts$/, ''));
768768
}
769769

770770
/**

0 commit comments

Comments
 (0)