From e60cfffc8350bd3087473e547d787f55f6b51161 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Thu, 15 Oct 2020 12:28:43 -0400 Subject: [PATCH] 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 4887f595d2cfddf2abc27cba1f9a54b7bc2c6bfb) --- packages/ngtools/webpack/src/resource_loader.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ngtools/webpack/src/resource_loader.ts b/packages/ngtools/webpack/src/resource_loader.ts index 54873f7b3e1b..cb3cbc234cdb 100644 --- a/packages/ngtools/webpack/src/resource_loader.ts +++ b/packages/ngtools/webpack/src/resource_loader.ts @@ -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.`, ); }