Angular CLI:无法更改index.html中的基础 [英] Angular CLI: Can't change base in index.html

查看:97
本文介绍了Angular CLI:无法更改index.html中的基础的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有由 Angular CLI 工具生成的 Angular 2 应用.

I have Angular 2 app generated by Angular CLI tool.

当我将 base 更改为 index.html 中的任何值时:

When I change base to any value in index.html:

<base href="test">

并构建应用程序(ng build),结果 index.html 具有:

and build the app (ng build) the resulted index.html has:

<base href="/">

所以我的问题是:如何更改index.html中的库?

感谢您的帮助.

推荐答案

ng build上使用--base-href选项. https://github.com/angular/angular-cli/wiki/build

这篇关于Angular CLI:无法更改index.html中的基础的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆