Answer the question
In order to leave comments, you need to log in
How can gulp extract the files declared in the "main" section of the bower.json file from node_modules?
There is a task to connect bxslider to the project, and for someone else's ideological reasons, I cannot use bower.
The bxslider is loaded via npm install, the js component is connected via browserify and has nothing to do with the question.
It is necessary to extract some files declared in bower.json via gulp:
"dist/jquery.bxslider.css",
"dist/images/bx_loader.gif",
"dist/images/controls.png"
And put them in the assets/dist/ folder bxslider. It seemed to me that the simplest solution was to do this:
gulp.task('bxslider', function(){
var bower = mainBowerFiles({
paths: {
bowerDirectory: 'node_modules',
//bowerrc: '.bowerrc',
bowerJson: 'node_modules/bxslider/bower.json'
},
overrides: {
bxslider: {
main: [
'**/images/*',
'**/jquery.bxslider.css'
]
}
}
});
return gulp.src(bower)
.pipe(gulp.dest('assets/dist/bxlider'));
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question