Answer the question
In order to leave comments, you need to log in
How to copy nested files but without parent folders (Gulp.js)?
Let's say the structure is like this:
1
└── 2
└── 3
└── copyme.js
root/**/*.js
) destination
ONLY files (without parent folders) must be copied to. it should look something like this:destination/
├── copyme1.js
├── copyme2.js
└── copyme3.js
var path = {
src: 'root/**/*.js',
dest: 'destination'
};
gulp.task('copy', function(){
return gulp.src(path.src)
.pipe(gulp.dest(path.dest))
});
Answer the question
In order to leave comments, you need to log in
var rename = require('gulp-rename');
gulp.src('app/client/**/*.html')
.pipe(rename({dirname: ''}))
.pipe(gulp.dest('dist'));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question