Skip to content

Commit e60cfff

Browse files
clydinalan-agius4
authored andcommitted
fix(@ngtools/webpack): improve bad component resource error message
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)
1 parent 791f574 commit e60cfff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/ngtools/webpack/src/resource_loader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class WebpackResourceLoader {
5656
// Simple sanity check.
5757
if (filePath.match(/\.[jt]s$/)) {
5858
return Promise.reject(
59-
'Cannot use a JavaScript or TypeScript file for styleUrl or templateUrl.',
59+
`Cannot use a JavaScript or TypeScript file (${filePath}) in a component's styleUrls or templateUrl.`,
6060
);
6161
}
6262

0 commit comments

Comments
 (0)