Copy the font folder using Gulp?

Asked

Viewed 246 times

1

How to create a task to copy the bootstrap font folder to the build folder? I created the following task but it’s 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 present me any error, but the task is not executed, because the fonts folder is not created in build.

  • Was it a mistake? Explain better this "not working".

  • @Marcelodern it does not error, nor executes the task actually, the fonts folder is not created in the build folder

1 answer

1


I found the problem, I was not calling this function on 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']);
    });

});

Browser other questions tagged

You are not signed in. Login or sign up in order to post.