Wiredep подключает js файлы, но не подключает css. Что я делаю не так?

html:
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<!-- bower:css -->
	<!-- endbower -->
</head>
<body>
	<!-- bower:js -->
	<!-- endbower -->
</body>
</html>


gulp-file:
var gulp = require('gulp'),
    wiredep = require('wiredep').stream;

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


package.json:
{
  "name": "manifest",
  "version": "0.1.0",
  "devDependencies": {
    "gulp": "^3.9.0",
    "wiredep": "^2.2.2"
  }
}


bower.json:
{
  "name": "manifest",
  "version": "0.1.0",
  "description": "my first bower project",
  "license": "MIT",
  "dependencies": {
    "bootstrap": "~3.3.5",
    "jquery": "~2.1.4"
  }
}


.bowerrc:
{
  "directory" : "bower_components"
}


Запускаю wiredep, результат такой:
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<!-- bower:css -->
	<!-- endbower -->
</head>
<body>
	<!-- bower:js -->
	<script src="bower_components/jquery/dist/jquery.js"></script>
	<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
	<!-- endbower -->
</body>
</html>


Стили не подключаются

wiredep ставил также крайнюю версию (3.0) не помогло.
Как решить проблему?
  • Вопрос задан
  • 454 просмотра
Решения вопроса 1
@leshiple Автор вопроса
В случае с Bootstrap:
В файле:
bower_components/bootstrap/bower.json
Секцию:
"main": [
    "less/bootstrap.less",
    "dist/js/bootstrap.js"
  ],

Необходимо поменять на:
"main": [
    "dist/css/bootstrap.css",
    "dist/js/bootstrap.js"
  ],
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы