E
E
Enniack2015-09-08 12:41:25
Building projects
Enniack, 2015-09-08 12:41:25

What to do if .css is missing in "main" in bower.json (when working with bower + wiredep)?

I use gulp, bower + wiredep:

<!-- bower:css -->
...
<!-- endbower -->

But often when connecting a plugin, for example FontAwesome, in bower.json in "main" there is no path to .css, but there are paths for .less or .scss
"less/font-awesome.scss"
"sass/font-awesome.sass"

If you write pens there,
"css/font-awesome.css"
then wiredep, of course, connects this .css to html
. But I, in my opinion, do not use wiredep for this.
Am I doing something wrong? How to solve this problem? Or is there no solution, to connect unconnected files yourself?
gulpfile.js
var gulp       = require('gulp');
   concatCSS   = require('gulp-concat-css');
   minifyCSS   = require('gulp-minify-css');
   rename      = require('gulp-rename');
   prefix      = require('gulp-autoprefixer');
   sass        = require('gulp-sass');
   uncss       = require('gulp-uncss');
   wiredep     = require('wiredep').stream;
   browserSync = require('browser-sync').create();
   reload      = browserSync.reload;

gulp.task('default', function() {
  return gulp.src('sass/*.sass')
    .pipe(sass())
  	/*.pipe(concatCSS("bundle.css"))
  	.pipe(prefix("last 30 versions"))
  	.pipe(minifyCSS(""))
  	.pipe(rename("bundle.min.css"))
  	.pipe(uncss({
  		html: ['index.html']
  	}))*/
  	.pipe(gulp.dest('app/'));
});

gulp.task('browser-sync', function() {
    browserSync.init({
        server: {
            baseDir: "./app"
        }
    });
    gulp.watch("app/*.html").on("change", browserSync.reload);
    gulp.watch('sass/*.sass', ['default'])
    gulp.watch("app/*.css").on("change", browserSync.reload);
});

gulp.task('bower', function () {
  gulp.src('./app/index.html')
    .pipe(wiredep({
      directory: 'app/libs'
    }))
    .pipe(gulp.dest('./app'));
})


gulp.task('watch', function () {
  gulp.watch('bower.json', ['bower'])
})

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2015-09-08
@streetflush

I would like the gulp.js code to the studio.
For example, wiredep works for me only at the time of bower install, but everything depends on the settings.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question