diff --git a/cli/run/batchWarnings.ts b/cli/run/batchWarnings.ts index 4b989d87ef8..e129a64f10a 100644 --- a/cli/run/batchWarnings.ts +++ b/cli/run/batchWarnings.ts @@ -237,7 +237,13 @@ const deferredHandlers: { UNUSED_EXTERNAL_IMPORT(warnings) { title('Unused external imports'); for (const warning of warnings) { - stderr(`${warning.names} imported from external module '${warning.source}' but never used`); + stderr( + `${warning.names} imported from external module '${warning.source}' but never used${ + warning.sources + ? ' in ' + printQuotedStringList(warning.sources.map(id => relativeId(id))) + : '' + }` + ); } } }; diff --git a/test/cli/samples/warn-import-export/_config.js b/test/cli/samples/warn-import-export/_config.js index c0c549251e3..4a7e9741762 100644 --- a/test/cli/samples/warn-import-export/_config.js +++ b/test/cli/samples/warn-import-export/_config.js @@ -16,7 +16,7 @@ module.exports = { assertIncludes( stderr, '(!) Unused external imports\n' + - "default imported from external module 'external' but never used\n" + `default imported from external module 'external' but never used in "main.js"\n` ); assertIncludes( stderr,