Я пытаюсь использовать grunt-wiredep для автоматической вставки любых компонентов Bower в мой html. Довольно прямолинейно, но я не уверен, как установить правильный путь к каталогу беседки при запуске локального хоста. На данный момент я получаю следующую ошибку:
http://localhost:9000/bower_components/jquery/dist/jquery.js Failed to load resource: the server responded with a status of 404 (Not Found)
Это моя структура
проект
app (содержит sass, js, html и т. д.)
Bower_components
node_modules
Bower.json
пакет.json
Gruntfile.js
HTML-файл
<!-- bower:js -->
<script src="../bower_components/modernizr/modernizr.js"></script>
<script src="../bower_components/jquery/dist/jquery.js"></script>
<!-- endbower -->
Файл Grunt
connect: {
server: {
options: {
port: 9000,
open: true,
livereload: 35729,
hostname: 'localhost',
base:config.app
},
livereload: {
options: {
middleware: function(connect) {
return [
connect.static(config.app),
connect().use('/bower_components', connect.static('./bower_components'))
];
}
}
}
}
},
wiredep: {
task: {
// Point to the files that should be updated when you run `grunt wiredep`
src: [
'<%= config.app %>/**/*.html', // .html support...
'<%= config.app %>/views/**/*.html', // .html support...
'<%= config.app %>/views/**/*.jade', // .jade support...
'<%= config.app %>/styles/app.scss', // .scss & .sass support...
'<%= config.app %>/config.yml' // and .yml & .yaml support out of the box!
],
options: {
// See wiredep's configuration documentation for the options https://github.com/taptapship/wiredep#configuration
}
}
}
bower install
в корневом каталоге проекта? - person andrusieczko   schedule 19.01.2015