angular-cli,route.hash = true和ng build

时间:2017-03-29 16:49:43

标签: angular webpack angular-cli

我使用angular-cli和ng build。当我运行<base href="/">时,它会为生成的index.html添加route.hash = true,从而搞砸了应用的加载。

我想使用<base href="/">,而不必每次都从生成的dist/index.html中删除标记{{1}}。

如何避免这种情况?

1 个答案:

答案 0 :(得分:0)

构建时不会动态添加<base href="/">。至少不是beta 24一直到1.0.0。它在/src/index.html中是静态的,只需将其从/src/index.html中删除即可,当您运行ng serve

时,它不会显示