Answer the question
In order to leave comments, you need to log in
Not moving folders in Gulp 4 with commands?
Here is the code in gulfile.js
//Include gulp modules
const gulp = require('gulp');
const concat = require('gulp-concat');
const cssFiles = [
'./src/css/main.css',
'./src/css/media.css'
]
const jsFiles= [
'src/js/lib.js',
'src/js/main.js '
]
//Task for CSS
styles function styles() {
//Template for searching CSS files
//All files matching the template './src/css/**/*.css'
return gulp.src(cssFiles)
//Output style folder
pipe(gulp.dest('./build/css'))
}
//Tack to js
scripts function scripts(){
return gulp.
pipe(gulp.dest('build/js'))
}
//The task that calls the styles function
gulp.task('styles', styles);
//Task that calls the scripts function
gulp.task('scripts', scripts);
When calling the gulp styles command in the terminal, it does not transfer the given files in the array to the build folder
Answer the question
In order to leave comments, you need to log in
gulp.task('copy', () =>
gulp.src(['./src/css/**/*.css', './src/js/**/*.js'], {base: './src/'} )
.pipe(gulp.dest('./build'))
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question