我正在Ionic开始一个新项目,并试图学习如何使用Gulp来构建我的应用程序。我有它工作......有点儿。我让Gulp自动注入项目文件,但它并没有像我希望的那样一致地使用库依赖项。
到目前为止,我已经安装了6个依赖项,但Gulp只抓取其中的2个(ng-lodash和angular-messages)。谁能看到我做错了什么?救命啊!
gulpfile.js
// other code
gulp.task('default', ['sass','index','wiredep']);
gulp.task('wiredep', function () {
gulp.src('./www/index.html')
.pipe(wiredep({
directory: './www/lib',
// devDependencies: true,
exclude: ['/angular/', 'angular-animate', 'angular-mocks', 'angular-resource', 'angular-sanitize', 'angular-ui-router']
}))
.pipe(gulp.dest('./www/'))
});
gulp.task('watch', function() {
gulp.watch(paths.sass, ['sass']);
gulp.watch([
paths.javascript,
paths.css
], ['index']);
gulp.watch('./www/index.html', ['wiredep']);
});
// other code
bower.json
{
"name": "HelloIonic",
"private": "true",
"devDependencies": {
"ionic": "driftyco/ionic-bower#1.1.0"
},
"dependencies": {
"robotodraft": "~1.1.0",
"Ionicons": "ionicons#~2.0.1",
"ng-lodash": "~0.3.0",
"font-awesome": "fontawesome#~4.4.0",
"angular-messages": "~1.4.7",
"ionic-toast": "~0.2.0"
}
}