Copy the source folder using gulp?

1

How to create a task to copy the bootstrap font folder to the build folder? I created the following task but it is not working.

var config = {
    assets_path: './resources/assets',
    build_path: './public/build'
};

config.bower_path = config.assets_path + '/../bower_components';

config.build_path_js = config.build_path + '/js';
config.build_vendor_path_js = config.build_path_js + '/vendor';

config.build_path_html = config.build_path + '/views';
config.build_path_fonts = config.build_path + '/fonts';
config.build_path_images = config.build_path + '/images';

gulp.task('copy-fonts', function() {
    gulp.src(config.bower_path + '/bootstrap/dist/fonts/**/*')
        .pipe(gulp.dest(config.build_path_fonts));
});

It does not show any errors, but the task is not executed, because the fonts folder is not created in the build.

    
asked by anonymous 08.08.2016 / 21:32

1 answer

1

I found the problem, I was not calling this function in default. Follow the solution code

gulp.task('default',['clear-build-folder'], function(){
    gulp.start('copy-fonts');
    elixir(function(mix) {
        //mix.sass('app.scss');
        mix.styles(config.vendor_path_css.concat([config.assets_path + '/css/**/*.css']), 'public/css/all.css', config.assets_path);
        mix.scripts(config.vendor_path_js.concat([config.assets_path + '/js/**/app.js']), 'public/js/all.js', config.assets_path);
        mix.version(['js/all.js', 'css/all.css']);
    });

});
    
08.08.2016 / 21:48