Skip to content

Commit

Permalink
fix(@ngtools/webpack): improve bad component resource error message
Browse files Browse the repository at this point in the history
The error message for when a TypeScript or JavaScript file is incorrectly used as a style or template within a component will now also provide the name of the file being incorrectly used.

(cherry picked from commit 4887f59)
  • Loading branch information
clydin authored and alan-agius4 committed Oct 15, 2020
1 parent 791f574 commit e60cfff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ngtools/webpack/src/resource_loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class WebpackResourceLoader {
// Simple sanity check.
if (filePath.match(/\.[jt]s$/)) {
return Promise.reject(
'Cannot use a JavaScript or TypeScript file for styleUrl or templateUrl.',
`Cannot use a JavaScript or TypeScript file (${filePath}) in a component's styleUrls or templateUrl.`,
);
}

Expand Down

0 comments on commit e60cfff

Please sign in to comment.