我的Angular2应用程序是用ng build构建的,它被挂载到https://[domainname]/app上.问题在于,在index.html中注入的脚本和样式的路径如下
src="styles.8e0edbbd6ad2cb36be49.bundle.js"所以,佩奇正试图从根中寻找它们。如何将其更改为:
src="./styles.8e0edbbd6ad2cb36be49.bundle.js"还是有其他正确的方式部署应用程序到域子路径与角CLI?
发布于 2016-12-14 14:27:52
使用以下命令构建使用cli的角2
# Sets base tag href to /myUrl/ in your index.html
ng build --base-href /myUrl/
ng build --bh /myUrl/https://stackoverflow.com/questions/41144962
复制相似问题