I have the following gulpfile
And I use emberate , which accepts a callback that is called when the generated file ( client/.index.jsin this case) was written. Now the task browserifydepends on this file, so it should not work until emberate ends. But I get different results, sometimes it works, and sometimes I get this:
Error: Cannot find the module. /client/.index.js' from '/ Users / myuser / workspace / myproject'
from the browser (and yes, the file does not exist yet). I'm not sure what I'm doing wrong, I have doneemberate as a callback in my task, and the view function depends on emberate. What am I missing?
Edit : found a small template, if I ran it, and this is not an error, the next time gulpI start, I get an error, but the next time I do not, so every time oO
If I run gulp emberate, this works fine. Then, if I run gulp browserify, it runs the following:
[gulp] Using file /Users/myuser/workspace/myproject/gulpfile.js
[gulp] Working directory changed to /Users/myuser/workspace/myproject
[gulp] Running 'clean'...
[gulp] Finished 'clean' in 3.11 ms
[gulp] Running 'emberate'...
[gulp] Finished 'emberate' in 22 ms
[gulp] Running 'browserify'...
[gulp] Live reload server listening on: 35729
events.js:72
throw er;
^
Error: Cannot find module './client/.index.js' from '/Users/myuser/workspace/myproject'
at /Users/myuser/workspace/myproject/node_modules/browserify/node_modules/resolve/lib/async.js:36:25
at load (/Users/myuser/workspace/myproject/node_modules/browserify/node_modules/resolve/lib/async.js:54:43)
at /Users/myuser/workspace/myproject/node_modules/browserify/node_modules/resolve/lib/async.js:60:22
at /Users/myuser/workspace/myproject/node_modules/browserify/node_modules/resolve/lib/async.js:16:47
at Object.oncomplete (fs.js:107:15)
This latest version seems to work, but during viewing, if the files have been changed, it does not clear the file client/.index.jsbut continues to add oO to it (although starting gulp emberatewith or without dependencies cleanworks just fine.).