【问题标题】:How can I select esNext in the menu of typescript in visual studio 2017如何在 Visual Studio 2017 的 typescript 菜单中选择 esNext
【发布时间】:2019-11-20 06:29:29
【问题描述】:

我在 Visual Studio 2017 中使用带有 typescript 的动态导入时出现以下错误:TS1323(TS) L'importation dynamique est Prize en charge uniquement quand l'indicateur '--module' a la valeur 'commonjs' ou 'esNext'。

所以,我尝试更改我的项目设置,但模块列表中没有 esNext。我尝试手动修改项目,但错误仍然存​​在。而且我不想为打字稿使用 .config 文件。

关于如何抑制此错误或在 vs2017 中添加 esNext 选项的任何解决方案?

【问题讨论】:

    标签: typescript asp.net-core visual-studio-2017


    【解决方案1】:

    我认为您的打字稿项目将有 1 个文件名tsconfig.json,因此您可以像这样将模块类型更改为 esNext

    {
        "compilerOptions": {
            "module": "esNext",
            // other prop
        }
    }
    

    【讨论】:

    • 我没有 tsconfig.json 文件。编译器选项直接在 .csproj () 中。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-07-28
    • 2018-02-25
    • 1970-01-01
    • 1970-01-01
    • 2018-06-04
    • 2018-05-20
    • 2017-05-28
    相关资源
    最近更新 更多