Commit 40322c5
committed
fix(@angular/build): return direct file contents for non-Angular TypeScript 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.1 parent ecf8c08 commit 40322c5
1 file changed
Lines changed: 1 addition & 1 deletion
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
459 | | - | |
| 459 | + | |
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
| |||
0 commit comments