handleUglify=function(src=null)->
if(typeof src !='string'){
src = source.js
}
var manifest_path = dest.js+"rev-manifest.json"
var newerOption = {dest:dest.js}
var stat = fs.existsSync(manifest_path)
if(stat){
var map=JSON.parse(fs.readFileSync(manifest_path, 'utf8'));
mapfunc=function(file_path){
return map[file_path]
}
newerOption.map=mapfunc
}
gulp.src(src,{"base":source.jsdir})
.pipe(newer(newerOption))
.pipe(uglify({bare: true}))
.pipe(rev())
.pipe(gulp.dest(dest.js))
.pipe(rev.manifest())
.pipe(gulp.dest(dest.js))
and some time,gulp fail silent:
$ gulp
[00:44:42] Requiring external module coffee-script/register
[00:44:44] Using gulpfile ~/work/python/crm/gulpfile.coffee
[00:44:44] Starting 'coffee'...
[00:44:44] Starting 'jsx'...
[00:44:45] Starting 'cssmin'...
[00:44:47] Finished 'jsx' after 3.71 s
[00:44:48] Finished 'coffee' after 4.35 s
[00:44:48] Starting 'uglify'...
[00:44:48] Finished 'cssmin' after 3.3 s
(.env)
there are not Finished 'uglify' like other task.
I add on('error',logError) on newer and get details:
[00:45:13] TypeError: Arguments to path.join must be strings
at Object.posix.join (path.js:488:13)
at Promise._successFn (/Users/zhutou/work/python/crm/node_modules/gulp-newer/index.js:100:37)
at Promise._call (/Users/zhutou/work/python/crm/node_modules/gulp-newer/node_modules/kew/kew.js:373:13)
I write my gulpfile like this:
and some time,gulp fail silent:
there are not
Finished 'uglify'
like other task. I addon('error',logError)
onnewer
and get details:in here:https://github.com/tschaub/gulp-newer/blob/master/index.js#L98 Should it add some code like
to judge the map function return value should not be undefined?