-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Watch omits files #261
Comments
Reformatted for reading gulp.task('script', function () {
return gulp.src(['js/**/*.js'])
.pipe(concat('appmain.js'))
.pipe(gulp.dest('build/js'))
.pipe(rename({
suffix: '.min'
}))
.pipe(ngmin())
.pipe(uglify({
mangle: false
}))
.pipe(gulp.dest('build/js'));
});
gulp.task('watch', function () {
gulp.watch('scss/**/*.scss', ['styles']);
gulp.watch('js/**/*.js', ['script']);
}); |
Thank you for the reformatting. I believe I may have figured it out. I read in a different issue that gulp.watch stops on an error, I believe a bad bracket may have caused ngmin to throw an error thus halting gulp.watch, however this doesn't cause gulp to stop watching or compiling files it just has gulp discard the bad files. Is there a way to set up that it will end on an error? Perhaps make that a default? |
I tried playing around with it to see if I could fix this. So far
The above works fine with gulp script
The above however removes any file I edit from the final build. |
So your files in Can you post what the correct output should be, and what the incorrect output is? |
I don't believe they are very order sensitive. I haven't ran into an issue with that. For example, I have fileOne.js When I run gulp script I get a file appmain.min.js which has fileOne.js, fileTwo.js, and fileThree.js all concatenated. If I run gulp watch at first all three will be there however if I edit say fileThree.js now appmain.min.js will only contain fileOne.js and fileTwo.js |
@cranesandcaff Can you use gulp-debug between src and concat and post the logs from a broken scenario? |
Sure can. I wasn't aware of that. I'll throw it in and set it to watch. |
File [gulp] gulp-debug: end event fired (2014-02-12 19:07:11 UTC) I removed everything except the file that isn't being included and one other file for reference. |
Does appmain.js contain all of the files or is appmain.min.js the only problem? |
appmain.js doesn't contain them all either. where it says contents: ... it should say contents: angular.module('chm').controller('.... |
Possibly related |
Can I see your full gulpfile? |
My 2 cents: you don't need gulp-watch plugin, watch is a native feature of gulp and here you are using this one. |
I have the same issue using the gulp watch that is generated from the Yeoman gulp-webapp scaffold. It omits the stylesheet if I am working on it. |
I have been it by this bug, I was on 3.4, I have update to 3.5.2 and now every thing is working. |
I will try updating, thank you. |
I am on version 3.5.2 currently. |
Has anyone else had issue with this? |
Closing due to #355 - this will be fixed in gulp 4.0 |
If it isn't fixed in 4.0 then it is related to gulpjs/glob-watcher#4 |
Thank you for the update. I'll watch for Gulp 4.0! Thank you |
When using gulp.watch it will for some reason completely omit a file when saved.
When using gulp watch sometimes it will stop adding a file, for instance if I am working on 'functionOne.js" it will continue updating and minifying, then it will stop and when checking the concated appmain.js the code from 'functionOne.js' doesn't appear.
However if I then run 'gulp script' it will appear. If I then start watching again it will still not include that file.
The text was updated successfully, but these errors were encountered: