Last active
January 29, 2017 07:48
-
-
Save netsensei/3c81c0399e5696b9de30 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
Hi friend, see my template 👯 https://github.com/jdnichollsc/Ionic-Starter-Template