I have an existing working project with gulp workflow. Everything runs perfectly fine. My gulp uses this:
So, I decide it use it on new project for my team. I copy gulpfile.js
, package.json
to the new project folder and run npm install
. Everything is downloaded as usual. But when I try to run my gulp task, I came into this error:
TypeError: Object #<lib$es6$promise$promise$$Promise> has no method 'done'
at DestroyableTransform._transform (E:\www\myproject\node_modules\gulp-less\index.js:68:8)
After some testing I found that that the problem is actually caused by gulp-wrap
, which it can be solved by:
gulp-wrap
folder from the old project and override the new onegulp-wrap
usage and also the require() of it from gulpfile.jsAt first I thought it is caused by new version issue. So, I specifically specify the version in package.json
. But after run the npm install
, the same problem occur.
So, when I look into my gulpfile, there is only one place that uses gulp-wrap
.
wrap('(function(){"use strict"; <%= contents %>\n})();')
Is there anyway I can do the wrapping for this without using gulp-wrap
to avoid that problem from occur?
After some research, I found that gulp-insert (https://github.com/rschmukler/gulp-insert) does the job as well and so far I did not experience the problem I am facing with gulp-wrap.
It can be done with this:
.pipe(insert.wrap('(function(){"use strict";', '\n})();'))