The first time I run gulp uglify
, it won't create ./dist/concat.js
, because ./tmp/concat.js
doesn't exist. I presume this is because the concat
task is async, and hence there's no guarantee it's finished before uglify
gets run.
You can fix this as shown in Gulpfile-fixed.js
, presumably because when you return a stream gulp checks to see if it's finished before calling Uglify?
@jackfranklin You need to tell gulp somehow that the task is asynchronous and callback when it is done. There are a few ways you can do this. https://github.com/wearefractal/gulp#gulptaskname-deps-fn
I recommend returning the stream you create in the task. Also you don't need to create tmp files and folders, you can just