【问题标题】:Change path to script files in index.html @angular-cli更改 index.html @angular-cli 中脚本文件的路径
【发布时间】:2018-08-03 09:25:14
【问题描述】:

我将 index.html 的默认路径更改为 /Views/Home/index.cshtml。因为我正在使用 ASP.NET Core 2.0 来托管 Angular 应用程序。

现在的问题是,在运行ng build 时在 index.cshtml 中生成的所有脚本文件路径都生成了类似./../wwwroot/vendor.js 的 pth。

有没有办法改变指向~\vendor.js的路径?

谢谢

【问题讨论】:

    标签: angular asp.net-core angular-cli html-webpack-plugin


    【解决方案1】:

    尝试处理 --base-href 构建选项

    【讨论】:

    • 感谢@dc-p8,我在根目录下运行应用程序,所以 --base-href 在这里没有帮助。
    猜你喜欢
    • 1970-01-01
    • 2019-12-20
    • 1970-01-01
    • 1970-01-01
    • 2017-06-27
    • 2019-02-16
    • 2014-09-04
    • 1970-01-01
    • 2016-09-21
    相关资源
    最近更新 更多