Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

Make gulp work properly #1164

Merged
merged 5 commits into from
Aug 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,15 +353,15 @@ Generator.prototype.packageFiles = function packageFiles() {
this.template('root/_bowerrc', '.bowerrc');
this.template('root/_package.json', 'package.json');
if (this.gulp) {
this.template('root/_Gulpfile.js', 'Gulpfile.js');
this.template('root/_gulpfile.js', 'gulpfile.js');
} else {
this.template('root/_Gruntfile.js', 'Gruntfile.js');
}
if (this.typescript) {
this.template('root/_tsd.json', 'tsd.json');
}
this.template('root/README.md', 'README.md');

};

Generator.prototype._injectDependencies = function _injectDependencies() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ var lintScripts = lazypipe()<% if (coffee) { %>
.pipe($.jshint.reporter, 'jshint-stylish');<% } %>

var styles = lazypipe()<% if (sass) { %>
.pipe($.rubySass, {
style: 'expanded',
.pipe($.sass, {
outputStyle: 'expanded',
precision: 10
})<% } %>
.pipe($.autoprefixer, 'last 1 version')
Expand Down Expand Up @@ -102,35 +102,34 @@ gulp.task('start:server:test', function() {
});

gulp.task('watch', function () {

$.watch({glob: paths.styles})
$.watch(paths.styles)
.pipe($.plumber())
.pipe(styles())
.pipe($.connect.reload());

$.watch({glob: paths.views.files})
$.watch(paths.views.files)
.pipe($.plumber())
.pipe($.connect.reload());

$.watch({glob: paths.scripts})
$.watch(paths.scripts)
.pipe($.plumber())
.pipe(lintScripts())<% if (coffee) { %>
.pipe($.coffee({bare: true}).on('error', $.util.log))
.pipe(gulp.dest('.tmp/scripts'))<% } %>
.pipe($.connect.reload());

$.watch({glob: paths.test})
$.watch(paths.test)
.pipe($.plumber())
.pipe(lintScripts());

gulp.watch('bower.json', ['bower']);
});

gulp.task('serve', function (callback) {
gulp.task('serve', function (cb) {
runSequence('clean:tmp',
['lint:scripts'],
['start:client'],
'watch', callback);
'watch', cb);
});

gulp.task('serve:prod', function() {
Expand Down Expand Up @@ -164,13 +163,7 @@ gulp.task('bower', function () {
// Build //
///////////

gulp.task('build', function (callback) {
runSequence('clean:dist',
['images', 'copy:extras', 'copy:fonts', 'client:build'],
callback);
});

gulp.task('clean:dist', function () {
gulp.task('clean:dist', function (cb) {
rimraf('./dist', cb);
});

Expand Down Expand Up @@ -218,3 +211,9 @@ gulp.task('copy:fonts', function () {
return gulp.src(yeoman.app + '/fonts/**/*')
.pipe(gulp.dest(yeoman.dist + '/fonts'));
});

gulp.task('build', ['clean:dist'], function () {
runSequence(['images', 'copy:extras', 'copy:fonts', 'client:build');
});

gulp.task('default', ['build']);
2 changes: 1 addition & 1 deletion templates/common/root/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"lazypipe": "^0.2.4",
"gulp-ng-annotate": "^1.0.0",
"open": "0.0.5"<% if (sass) { %>,
"gulp-ruby-sass": "^0.4.3"<% } %><% if (coffee) { %>,
"gulp-sass": "^2.0.4"<% } %><% if (coffee) { %>,
"gulp-coffeelint": "^0.5.0",
"gulp-coffee": "^2.3.1",<% } %><% } else { %>
"autoprefixer-core": "^5.2.1",
Expand Down