Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): allow esbuild-based builder to us…
Browse files Browse the repository at this point in the history
…e SVG Angular templates

The experimental esbuild-based browser application builder will now consider SVG files as
Angular component templates. Previously, only HTML files were considered templates and this
resulted in the esbuild-based builder to try to process the SVG file as a stylesheet.

(cherry picked from commit d50d09f)
  • Loading branch information
clydin committed Aug 29, 2022
1 parent da4fcad commit 2b00bca
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -213,8 +213,8 @@ export function createCompilerPlugin(
// The AOT compiler currently requires this hook to allow for a transformResource hook.
// Once the AOT compiler allows only a transformResource hook, this can be reevaluated.
(host as CompilerHost).readResource = async function (fileName) {
// Template resources (.html) files are not bundled or transformed
if (fileName.endsWith('.html')) {
// Template resources (.html/.svg) files are not bundled or transformed
if (fileName.endsWith('.html') || fileName.endsWith('.svg')) {
return this.readFile(fileName) ?? '';
}

Expand Down

0 comments on commit 2b00bca

Please sign in to comment.