【问题标题】:Running javascript files with ES6 module imports in ASP.Net Core 2.x在 ASP.Net Core 2.x 中使用 ES6 模块导入运行 javascript 文件
【发布时间】:2019-06-18 01:42:18
【问题描述】:

我想使用 .Net Core 中的 NodeServices 执行一个脚本,该脚本会导入 ES6 模块。

我设法使用带有 --experimental-modules 标志的 NodeJs 执行脚本。

是否有任何使用 NodeServices 的等价物? 我的 javascript 文件可以从其他脚本导入或依赖吗?

【问题讨论】:

    标签: javascript node.js asp.net-core ecmascript-6 .net-core


    【解决方案1】:

    那么您在添加服务时是否尝试设置环境变量?

    services.AddNodeServices((xx)=>
    {
        xx.EnvironmentVariables
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-04-12
      • 2016-09-16
      • 2021-12-08
      • 1970-01-01
      • 1970-01-01
      • 2017-01-04
      • 2018-07-06
      相关资源
      最近更新 更多