【问题标题】:Angular project with 2 base-href configurations具有 2 个 base-href 配置的 Angular 项目
【发布时间】:2019-04-06 11:36:49
【问题描述】:

Angular CLI:7.2.3 节点:10.14.1 操作系统:达尔文 x64 角度:7.2.2

我当前的 index.html 的基本 href 设置为 <base href="/" />,我的应用程序在 http://localhost:port/ 运行

是否可以让我的应用在本地和生产构建中同时在 http://localhost:port/http://localhost:port/something/ 上运行,而无需在构建时设置 --base-href 标志或 ng serve

【问题讨论】:

    标签: angular angular6 ionic4


    【解决方案1】:

    你可以使用

    ng build --prod --base-href any value
    i.e ng build --prod --base-href ./
    

    【讨论】:

    • 谢谢@Zoha,但是我需要在同一个版本中同时使用 / 和 /something base href
    猜你喜欢
    • 2016-12-07
    • 2016-11-23
    • 1970-01-01
    • 2020-11-21
    • 1970-01-01
    • 2020-06-28
    • 2017-04-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多