javascript - Gulp does't copy all files as expected -
javascript - Gulp does't copy all files as expected -
i tried create gulpfile.js personal website project. i've never done before little 'trial , error' works in acceptable way.
the thing doesn't work after 1000 modifications simple copying files , folders.
var files = { data_src : [ './files.json', 'data/**/*.*' ], distribution_dest : '_distribution' }; gulp.task('copy-data', function() { gulp.src(files.data_src, { base: './' }) .pipe(gulp.dest(files.distribution_dest)) .pipe(notify({message: 'data copied distribution!'})); });
this should re-create sub-folders , files gulp.dest
. copies half of them, folders ignored if alter names etc. (no special characters, same subfolder construction 1 time got copied correctly ...) - nil worked. can't see pattern in this.
there no error message while running gulp. nil help me find error.
why folders or files excluded copying?
i utilize base
maintain folder / sub-folder structure; tried , without 'base' -> no effects on copying process.
i changed position of 'copy-data' task in run-list. it's first task run. there seems no alter in behavior no matter if it's first or lastly one.
gulp.task('default', function() { gulp.run('copy-data', 'custom-sass', 'framework-sass', 'custom-js', 'framework-js', 'replace-tags', 'browser-sync'); ... watches ... });
the construction of info folder looks these:
./data |-doc |---content |---template |-img |---chart |---icon |---logo |---pattern |---people |---photo |---symbol |-----brandklassen |-----brandschutzzeichen |-----gebotszeichen |-----gefahrensymbole |-----rettungszeichen |-----verbotszeichen |-----verkehrsrechtzeichen |-----warnzeichen |---wallpaper
/data/doc
, subfolders ok. /data/img/chart
/data/img/people
ok.
within /data/img/photo
14 out of 21 images copied. /data/img/symbol
sub-folders , /data/img/wallpaper
ignored completely.
solved myself! problem caused async operating tasks. adding return
forced gulp finish copying process before continuing!
gulp.task('copy-data', function() { homecoming gulp.src(files.data_src, { base: './' }) .pipe(gulp.dest(files.distribution_dest)) .pipe(notify({message: 'data copied distribution!'})) });
now images copied!
javascript gulp
Comments
Post a Comment