我的問題如下;我正在使用grunt-include-source(https://www.npmjs.com/package/grunt-include-source)將我的腳本和css包括到我的index.html中,這個工作正常,但我只能指定一個basepath,並且我想爲dev和production都設置這個插件。 (使用相同的文件夾結構,所以什麼都不會在我的index.html改變IM,唯一不同的是,在我的生產串連)grunt-include-source多種配置
includeSource: {
options: {
basePath: 'dev'
},
myTarget: {
files: {
'dev/index.html': 'app/index.html'
}
}
},
上面的代碼工作正常,現在我想有2個不同的配置,開發:但在運行任務時includeSource這樣的事情不工作
includeSource: {
dev: {
options: {
basePath: 'dev'
},
myTarget: {
files: {
'dev/index.html': 'app/index.html'
}
}
},
prod: {
options: {
basePath: 'prod'
},
myTarget: {
files: {
'prod/index.html': 'app/index.html'
}
}
}
},
的index.html:
<!-- include: "type": "js", "files": "scripts/*.js" -->
任何人都可以幫助我如何我就能夠實現這一目標?
編輯:只是要一個多一點清晰,即時運行此腳本我建立了生產或開發完成後,對於我的督促/ dev的所有腳本都存儲在腳本/
親切的問候後,
摹
您如何運行'prod'任務? – URL87