F
F
Faber Estello2017-03-22 11:20:19
gulp.js
Faber Estello, 2017-03-22 11:20:19

How to transfer files using gulp build?

There is a project structure like this:

├── app
         ├── css
         ├── js
         ├── index.html
         ├── .htaccess
         ├── sitemap.xsl
         ├── ...
├── dist   
         ├── css
         ├── js
         ├── index.html
├── gulpfile.js
├── package.json

gulpfile.js:
...
gulp.task('html', function(){
  gulp.src(path.app.html)
                 ... 
    .pipe(gulp.dest(path.dist.html));
});

gulp.task('css, function(){
  gulp.src(path.app.css)
                 ... 
    .pipe(gulp.dest(path.dist.css));
});

...

Everything is transferred as expected from appto dist, except for files like .htaccess, sitemap.xsl, readme.md, ...
How can I configure gulp so that these files are automatically transferred too?
To get a structure like this:
├── app
         ├── css
         ├── js
         ├── index.html
         ├── .htaccess
         ├── sitemap.xsl
         ├── ...
├── dist   
         ├── css
         ├── js
         ├── index.html
         ├── .htaccess
         ├── sitemap.xsl
         ├── ...
├── gulpfile.js
├── package.json

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2017-03-22
@senselessV7

gulp.task('mytask', function(){
  gulp.src('app/*.*')
      .pipe(gulp.dest('dist/'));
});

gulp.task('html', ['mytask'], function(){
  gulp.src(path.app.html)
                 ... 
    .pipe(gulp.dest(path.dist.html));
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question