K
K
korner-brazers2017-07-27 12:49:29
gulp.js
korner-brazers, 2017-07-27 12:49:29

Bower + Gulp how to collect fonts, pictures and structure?

Hello everyone, I’m studying Bower and Gulp, I liked Bower, it’s convenient to connect plugins, but where there are pluses there are also minuses) at least I still don’t understand how to build the plugin that I downloaded using bower.
Here is my code:

var mainBowerFiles = require('main-bower-files');
var bowerNormalize = require('gulp-bower-normalize');

gulp.task('main-bower-files', function() {

    return gulp.src(mainBowerFiles())
    	.pipe(bowerNormalize({ bowerJson: './bower.json'  }))
        .pipe(gulp.dest(distFolder+'/components'))
});

gulp-bower-normalize saves the day a bit, creates folders js and css , almost but not that) I don’t like the fact that these folders immediately contain files, I would like to have a normal look, like this:
css/
->css->bootstrap
->css->bootstrap->bootstrap.min.css
->css->flexslider
->css->flexslider->flexslider.min.css
That is, all files from the package should be in their own folder, but this is not the whole problem , as you know, plugins can have pictures and fonts, but I can’t find how to collect them in Google, manually copying everything is stupid, then this Bower will be good for me))
Here is an example of a plugin https://github.com/woocommerce/FlexSlider has fonts and one picture, I would like to assemble it in a human form.
plugins/
plugins->flexslider/
plugins->flexslider->fonts/
plugins->flexslider->fonts/...
plugins->flexslider->images/
plugins->flexslider->images/...
plugins->flexslider- >css/
plugins->flexslider->css/...
It turns out the structure is exactly the same as in the original plugin)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Kit, 2017-07-27
@ShadowOfCasper

When you get tired of cycling, use yeoman.io
and use npm. Bower is no longer needed in 2k17

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question