Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(@angular-devkit/build-angular): skip Angular linker in JIT mode with esbuild #24961

Merged
merged 1 commit into from Apr 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -399,7 +399,7 @@ export function createCompilerPlugin(
// would need to be added to the key as well as a check for any change of content.
let contents = pluginOptions.sourceFileCache?.babelFileCache.get(args.path);
if (contents === undefined) {
contents = await javascriptTransformer.transformFile(args.path);
contents = await javascriptTransformer.transformFile(args.path, pluginOptions.jit);
pluginOptions.sourceFileCache?.babelFileCache.set(args.path, contents);
}

Expand Down
Expand Up @@ -54,13 +54,15 @@ export class JavaScriptTransformer {
* Performs JavaScript transformations on a file from the filesystem.
* If no transformations are required, the data for the original file will be returned.
* @param filename The full path to the file.
* @param skipLinker If true, bypass all Angular linker processing; if false, attempt linking.
* @returns A promise that resolves to a UTF-8 encoded Uint8Array containing the result.
*/
transformFile(filename: string): Promise<Uint8Array> {
transformFile(filename: string, skipLinker?: boolean): Promise<Uint8Array> {
// Always send the request to a worker. Files are almost always from node modules which measn
// they may need linking. The data is also not yet available to perform most transformation checks.
return this.#workerPool.run({
filename,
skipLinker,
...this.#commonOptions,
});
}
Expand Down