Can you remove a folder structure when copying files in gulp?

前端 未结 2 1786
南旧
南旧 2020-11-29 02:25

If I use :

 gulp.src([\'app/client/**/*.html\'])
  .pipe(gulp.dest(\'dist\'));

The folder structure in which my .html files w

2条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-29 02:42

    You can use gulp-flatten https://www.npmjs.com/package/gulp-flatten

        app
        ├── logo
        │   └── logo.styl
        └── sidebar
            └── sidebar.styl
        
        var flatten = require('gulp-flatten');
        gulp.src('app/**/*.styl')
          .pipe(flatten())
          .pipe(gulp.dest('dist/'));
        
        dist
        ├── logo.styl
        └── sidebar.styl
        

提交回复
热议问题