我使用angular-cli和router.forRoot({hash: true})
。当我运行ng build
时,它给了我一个<base href="/">
添加到生成的index.html
,从而锁定应用程序的加载。angular-cli,route.hash = true和ng build
我想使用route.hash = true
而不必删除每次从生成dist/index.html
标记<base href="/">
。
如何避免这种情况?
我使用angular-cli和router.forRoot({hash: true})
。当我运行ng build
时,它给了我一个<base href="/">
添加到生成的index.html
,从而锁定应用程序的加载。angular-cli,route.hash = true和ng build
我想使用route.hash = true
而不必删除每次从生成dist/index.html
标记<base href="/">
。
如何避免这种情况?
<base href="/">
未在构建中动态添加。至少不是beta 24,一直到1.0.0。这是静态的/src/index.html
只是从/src/index.html
中删除它,它不应该出现在您运行时ng serve
我的角度cli版本是1.0.0-beta.22-1,我没有
你使用的是旧版本,有没有考虑更新? –
你可能是对的。问题是,我花了几天的时间尝试更新到最新版本(4),没有太多的运气,但我认为这是时间和耐心的问题:)。希望升级解决了这个问题。再次感谢。 –
Excuseme,英语不是我的第一语言。我想说'它给了我 添加到生成的index.html',而不是'它给了我一个添加到生成的index.html'。希望现在更清楚。 –