-
Notifications
You must be signed in to change notification settings - Fork 659
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
var gulp = require('gulp'), | ||
gulpWatch = require('gulp-watch'), | ||
del = require('del'), | ||
argv = process.argv; | ||
|
||
/** | ||
* Ionic Gulp tasks, for more information on each see | ||
* https://github.com/driftyco/ionic-gulp-tasks | ||
*/ | ||
var buildWebpack = require('ionic-gulp-webpack-build'); | ||
var buildSass = require('ionic-gulp-sass-build'); | ||
var copyHTML = require('ionic-gulp-html-copy'); | ||
var copyFonts = require('ionic-gulp-fonts-copy'); | ||
|
||
gulp.task('watch', ['sass', 'html', 'fonts'], function(){ | ||
gulpWatch('app/**/*.scss', function(){ gulp.start('sass'); }); | ||
gulpWatch('app/**/*.html', function(){ gulp.start('html'); }); | ||
return buildWebpack({ watch: true }); | ||
}); | ||
gulp.task('build', ['sass', 'html', 'fonts'], buildWebpack); | ||
gulp.task('sass', buildSass); | ||
gulp.task('html', copyHTML); | ||
gulp.task('fonts', copyFonts); | ||
gulp.task('clean', function(done){ | ||
del('www/build', done); | ||
}); | ||
|
||
/** | ||
* Ionic hooks | ||
* Add ':before' or ':after' to any Ionic project command name to run the specified | ||
* tasks before or after the command. | ||
*/ | ||
gulp.task('serve:before', ['watch']); | ||
gulp.task('emulate:before', ['build']); | ||
gulp.task('deploy:before', ['build']); | ||
|
||
// we want to 'watch' when livereloading | ||
var shouldWatch = argv.indexOf('-l') > -1 || argv.indexOf('--livereload') > -1; | ||
gulp.task('run:before', [shouldWatch ? 'watch' : 'build']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters