|
@@ -30,13 +30,6 @@ gulp.task('styles', function () {
|
|
|
.pipe($.size());
|
|
|
});
|
|
|
|
|
|
-gulp.task('scripts', function () {
|
|
|
- return gulp.src('app/scripts/**/*.js')
|
|
|
- .pipe($.jshint())
|
|
|
- .pipe($.jshint.reporter(require('jshint-stylish')))
|
|
|
- .pipe($.size());
|
|
|
-});
|
|
|
-
|
|
|
gulp.task('html', ['styles'], function () {
|
|
|
var jsFilter = $.filter('**/*.js');
|
|
|
var cssFilter = $.filter('**/*.css');
|
|
@@ -48,7 +41,6 @@ gulp.task('html', ['styles'], function () {
|
|
|
.pipe($.uglify())
|
|
|
.pipe(jsFilter.restore())
|
|
|
.pipe(cssFilter)
|
|
|
- // .pipe($.csso())
|
|
|
.pipe(cssFilter.restore())
|
|
|
.pipe($.useref.restore())
|
|
|
.pipe($.useref())
|
|
@@ -63,11 +55,6 @@ gulp.task('views', function() {
|
|
|
|
|
|
gulp.task('images', function () {
|
|
|
return gulp.src('app/images/**/*')
|
|
|
- .pipe($.cache($.imagemin({
|
|
|
- optimizationLevel: 3,
|
|
|
- progressive: true,
|
|
|
- interlaced: true
|
|
|
- })))
|
|
|
.pipe(gulp.dest('dist/images'))
|
|
|
.pipe($.size());
|
|
|
});
|
|
@@ -94,41 +81,3 @@ gulp.task('build', ['html', 'views', 'images', 'fonts', 'extras']);
|
|
|
gulp.task('default', ['clean'], function () {
|
|
|
gulp.start('build');
|
|
|
});
|
|
|
-
|
|
|
-gulp.task('connect', function () {
|
|
|
- var connect = require('connect');
|
|
|
- var app = connect()
|
|
|
- .use(require('connect-livereload')({ port: 35729 }))
|
|
|
- .use(connect.static('app'))
|
|
|
- .use(connect.static('.tmp'))
|
|
|
- .use(connect.directory('app'));
|
|
|
-
|
|
|
- require('http').createServer(app)
|
|
|
- .listen(9000)
|
|
|
- .on('listening', function () {
|
|
|
- console.log('Started connect web server on http://localhost:9000');
|
|
|
- });
|
|
|
-});
|
|
|
-
|
|
|
-gulp.task('serve', ['connect'], function () {
|
|
|
- require('opn')('http://localhost:9000');
|
|
|
-});
|
|
|
-
|
|
|
-gulp.task('watch', ['connect', 'serve'], function () {
|
|
|
- var server = $.livereload();
|
|
|
-
|
|
|
- // watch for changes
|
|
|
-
|
|
|
- gulp.watch([
|
|
|
- 'app/*.html',
|
|
|
- '.tmp/styles/**/*.css',
|
|
|
- 'app/scripts/**/*.js',
|
|
|
- 'app/images/**/*'
|
|
|
- ]).on('change', function (file) {
|
|
|
- server.changed(file.path);
|
|
|
- });
|
|
|
-
|
|
|
- gulp.watch('app/styles/**/*.css', ['styles']);
|
|
|
- gulp.watch('app/scripts/**/*.js', ['scripts']);
|
|
|
- gulp.watch('app/images/**/*', ['images']);
|
|
|
-});
|