Make error message for dynamic imports when module is ES2015 more helpful

This commit is contained in:
Paul Koerbitz 2018-05-08 07:45:48 +02:00
parent beb7fd884f
commit ba360cfc4f
2 changed files with 2 additions and 2 deletions

View file

@ -28103,7 +28103,7 @@ namespace ts {
function checkGrammarImportCallExpression(node: ImportCall): boolean {
if (moduleKind === ModuleKind.ES2015) {
return grammarErrorOnNode(node, Diagnostics.Dynamic_import_cannot_be_used_when_targeting_ECMAScript_2015_modules);
return grammarErrorOnNode(node, Diagnostics.Dynamic_import_cannot_be_used_when_targeting_ECMAScript_2015_modules_Please_use_esnext_or_commonjs_as_module_compiler_option);
}
if (node.typeArguments) {

View file

@ -895,7 +895,7 @@
"category": "Error",
"code": 1322
},
"Dynamic import cannot be used when targeting ECMAScript 2015 modules.": {
"Dynamic import cannot be used when targeting ECMAScript 2015 modules. Please use 'esnext' or 'commonjs' as module compiler option.": {
"category": "Error",
"code": 1323
},