fix(@angular/build): return direct file contents for non-Angular TypeScript files - #33808
Open
alan-agius4 wants to merge 1 commit into
Open
fix(@angular/build): return direct file contents for non-Angular TypeScript files#33808alan-agius4 wants to merge 1 commit into
alan-agius4 wants to merge 1 commit into
Conversation
alan-agius4
marked this pull request as ready for review
August 7, 2026 15:27
…Script files When a TypeScript file is requested that was not emitted by the TypeScript program compiler (`contents === undefined`), the compiler plugin checks whether the file requires Angular compiler transformations via `requiresAngularCompiler(directContents)`. If the file does not require the Angular compiler, the load hook returns an object with `loader: 'ts'` and a missing file warning so esbuild can compile it directly. However, it previously returned `contents` (which was still `undefined`) instead of `directContents` (which was read directly from disk via `readFile`). This caused esbuild to receive an empty/undefined content object rather than the actual file source code. This change ensures `contents: directContents` is returned so esbuild can properly transpile the file.
alan-agius4
force-pushed
the
fix-build-compiler-plugin-non-angular-ts
branch
from
August 7, 2026 15:27
800d25e to
40322c5
Compare
There was a problem hiding this comment.
Code Review
This pull request updates the Angular compiler plugin for esbuild to return directContents instead of contents when a file does not require the Angular compiler. This ensures the correct file contents are passed through the build pipeline. There are no review comments, and I have no additional feedback to provide.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a TypeScript file is requested that was not emitted by the TypeScript program compiler (
contents === undefined), the compiler plugin checks whether the file requires Angular compiler transformations viarequiresAngularCompiler(directContents).If the file does not require the Angular compiler, the load hook returns an object with
loader: 'ts'and a missing file warning so esbuild can compile it directly. However, it previously returnedcontents(which was stillundefined) instead ofdirectContents(which was read directly from disk viareadFile). This caused esbuild to receive an empty/undefined content object rather than the actual file source code.This change ensures
contents: directContentsis returned so esbuild can properly transpile the file.