我試圖更新應用程序以支持節點-v 7.7.3。但是,當我運行繁重的任務dom_munger按如下:Dom_munger問題與節點7.7.3 - 路徑必須是字符串
dom_munger:{
read: {
options: {
read:[
{selector:'script[data-concat!="false"]',attribute:'src',writeto:'appjs', isPath: true},
{selector:'link[rel="stylesheet"][data-concat!="false"]',attribute:'href',writeto:'appcss'}
]
},
src: 'app/index.html'
}
}
我收到錯誤:
Warning: Path must be a string. Received [ 'app/index.html' ] Use --force to continue.
我不知道是否有改寫上述咕嚕任務的方式,或者有可能是一個很好的替代dom_munger。任何幫助,將不勝感激。
謝謝你!但是,如果Grunt和Index位於相同的文件夾結構中,這似乎只能工作。我的結構是這樣的: - /應用 -index.html - gruntfile.js 而如果沒有屬性「isPath」的dom_munger會找JS文件在同一目錄中,其中Gruntfile的地方。 – sandrasvensson
@sandrasvensson但你有沒有嘗試刪除'isPath'屬性?它似乎解決了[這個類似的問題](https://github.com/cgross/grunt-dom-munger/issues/42)。 –