Skip to content

Can't apply custom loader for component's 'templateUrl' since version 8 #14534

@MateEke

Description

@MateEke

🐞 Bug report

Command (mark with an x)

- [ ] new
- [x ] build
- [x ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

Yes, the previous version in which this bug was not present was: ^7

Description

In previous versions there was an error if you tried to use any unsupported filetype for templateUrl


ERROR in Module parse failed: Unexpected token (2:55)
You may need an appropriate loader to handle this file type.

Since .svg is supported there are no error, but the file is simply loaded with raw-loader

🔬 Minimal Reproduction

Create a new project with Angular: 8.0.0-rc.5
Try to use ng-cli-pug-loader or custom-webpack builder for .pug loading.

🌍 Your Environment


Angular CLI: 8.0.0-rc.4
Node: 12.3.1
OS: win32 x64
Angular: 8.0.0-rc.5
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.0-rc.4
@angular-devkit/build-angular     0.800.0-rc.4
@angular-devkit/build-optimizer   0.800.0-rc.4
@angular-devkit/build-webpack     0.800.0-rc.4
@angular-devkit/core              8.0.0-rc.4
@angular-devkit/schematics        8.0.0-rc.4
@angular/cli                      8.0.0-rc.4
@ngtools/webpack                  8.0.0-rc.4
@schematics/angular               8.0.0-rc.4
@schematics/update                0.800.0-rc.4
rxjs                              6.4.0
typescript                        3.4.5
webpack                           4.30.0

Anything else relevant?
The issue is present since .svg component template is supported - dfb08b9

#danguilherme/ng-cli-pug-loader#20

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions