我有一个吞吞吐吐的任务。它使用$.useref.assets
读取和连接资产(自身和供应商JS文件),然后使用$.useref
在index.html
中插入新连接文件的路径。它可以很好地用于生产。
但是当我在开发中运行gulp时,我只希望串联供应商JS文件,而不希望自己的JS文件。我只希望将自己的JS文件复制到目标位置,但不希望将其串联,并且还希望将此文件的路径插入index.html
文件中。有什么办法吗?
也许我也应该说,我正在使用Maven,最后 必须打包在战争文件中。
示例:
var assets = $.useref.assets({
searchPath: [
config.paths.base,
'node_modules'
]
});
// some code here
return gulp.src(config.paths.build.tmp.mainHtml)
.pipe(assets)
.pipe(assets.restore())
.pipe($.useref(config.consts.useref))
// some code here