1
我最近使用帶Grunt和Bower的Yeoman Angular發生器啓動了一個新項目。grunt-bower-install將bower_components鏈接到當前目錄
每當grunt構建我的應用程序時,grunt-bower-install會重新生成index.html文件中的所有bower_components鏈接。
無論出於何種原因,這些資產都鏈接到當前目錄而不是根目錄,所以當我導航到深度超過一個級別的新Url時,所有依賴關係都會中斷。
我該如何使組件鏈接到根目錄而不是當前目錄?
當前的結果:
<script src="bower_components/modernizr/modernizr.js"></script>
期望的結果:
<script src="/bower_components/modernizr/modernizr.js"></script>
Gruntfile:
'bower-install': {
app: {
html: '<%= yeoman.app %>/index.html',
ignorePath: '<%= yeoman.app %>/'
}
}
[Grunt不斷刪除我的絕對路徑]的可能重複(http://stackoverflow.com/questions/21722097/grunt-keeps-removing-my-absolute-paths) – Stephen