-
-
Save gbrennon/5b34942d5fc75c277974b0d284063d75 to your computer and use it in GitHub Desktop.
Extends Ionics' default Gulp.js with a scripts & bower-files task. Moves app/ source outside the www folder.
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
var gulp = require('gulp'); | |
var concat = require('gulp-concat'); | |
var sass = require('gulp-sass'); | |
var minifyCss = require('gulp-minify-css'); | |
var rename = require('gulp-rename'); | |
var gulpBowerFiles = require('gulp-bower-files'); | |
var paths = { | |
sass: ['./scss/**/*.scss'], | |
scripts: ['./app/**/*.js', './app/*.js'] | |
}; | |
gulp.task("bower-files", function(){ | |
gulpBowerFiles().pipe(gulp.dest("./www/lib")); | |
}); | |
gulp.task('sass', function(done) { | |
gulp.src('./scss/ionic.app.scss') | |
.pipe(sass()) | |
.pipe(gulp.dest('./www/css/')) | |
.pipe(minifyCss({ | |
keepSpecialComments: 0 | |
})) | |
.pipe(rename({ extname: '.min.css' })) | |
.pipe(gulp.dest('./www/css/')) | |
.on('end', done); | |
}); | |
gulp.task('scripts', function(done) { | |
gulp.src(['./app/*.js', './app/**/*.js']) | |
.pipe(concat('app.js')) | |
.pipe(gulp.dest('./www/js')) | |
.on('end', done); | |
}); | |
gulp.task('watch', function() { | |
gulp.watch(paths.sass, ['sass']); | |
gulp.watch(paths.scripts, ['bower-files', 'scripts']); | |
}); | |
gulp.task('default', ['sass']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment