gulp


Gulp dependant task not working properly


I have two gulp tasks, one to compile stylus files and the other is to clean my css files but I don't understand why only clean-styles run when I executed the command: gulp styles on the terminal.
gulp.task("clean-styles", function (done) {
clean(config.css + "**/*.css", done);
});
gulp.task("styles", ["clean-styles"], function () {
return gulp.src(config.styles)
.pipe($.plumber())
.pipe($.stylus())
.pipe(gulp.dest(config.css));
});
function clean(path, done) {
del(path, done);
}
I"m using Gulp version 3.9.0 I've done this on multiple project in the past and it seems to be working.
I'm not sure what I'm doing wrong. There are no errors in the console.
Expected Result:
I expect styles to run after the clean-styles task.
Actual Result: Only clean-styles run.
Thanks #kombucha for the heads up. It seems to be a change in the del package which caused this to no longer work.
gulp.task("clean-styles", function (done) {
clean(config.css + "**/*.css", done);
});
gulp.task("styles", ["clean-styles"], function () {
return gulp.src(config.styles)
.pipe($.plumber())
.pipe($.stylus())
.pipe(gulp.dest(config.css));
});
New Clean function:
function clean(path, done) {
del(path).then(function (paths) {
console.log("Cleaning: " + paths);
done();
});
}

Related Links

Gulp: how to delete a folder?
MSC Undefined Error Using Gulp In Visual Studio Code on OSX
A Gulp “process terminated with code 1”
how to enable intellisense in Visual Studio Code?
gulp dependency breaks gulp in the middle
No CSS with Gulp
gulp move files to parent directory
How to get gulp-jshint to ignore folders
Inserting specific file at index of a stream
How to pass array from gulp to other js files?
BrowserSync + Gulp with Vagrant not refreshing
gulp-tslint return undefined when required
Gulp watch only runs once
Gulp watch not working with imported files but works with main file
Gulp watch for css doesn't work
Using gulp for compiling of changed files only

Categories

HOME
c#
oop
msbuild
teradata
oracle-sqldeveloper
compression
cluster-analysis
opencv4android
arcgis
spotfire
arguments
sdk
yuv
procmon
kohana
python-3.4
ionic-native
runtime
select2
velocity
watson-dialog
box2d
infopath
jquery-easyui
views
google-street-view
beacon
autologin
bug-reporting
formulas
suitescript
knapsack-problem
workflow-foundation
large-files
angular-schema-form
xlib
lines
opencsv
imdb
postgresql-9.6
favorites
traitsui
webmock
intersection
android-databinding
lighting
kepserverex
nsdateformatter
tapply
cakephp-3.2
codepen
niagara-ax
weld
openpgp.js
liferay-ide
jtextarea
petapoco
cosign-api
patching
sqlxml
innertext
jcalendar
clearquest
tinymce-plugins
esb-toolkit-2.1
autopep8
data-quality-services
applinks
static-files
qxorm
javadb
fxmlloader
breeze-sharp
disparity-mapping
telerik-appbuilder
visual-studio-setup-proje
pthreads-win32
nomachine
ekevent
lastinsertid
maven-javadoc-plugin
svg-android
google-oauth-java-client
grape-api
aspnet-compiler
google-checkout
qmainwindow
string-length
microsoft-speech-platform
android-memory
diazo
pinchzoom
commonsware
norton
html5-animation
viewdata
for-xml
mysql-pconnect
manuals
retrospectiva
projectgen
onresize

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App