Last active
August 29, 2015 14:05
-
-
Save nicola/bf1bd15f53fc6587ad16 to your computer and use it in GitHub Desktop.
Gulpfile.js to deploy and live-edit css on FirefoxOS
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 deploy = require('moz-deploy-b2g'); | |
var reloadcss = require('moz-reloadcss-b2g'); | |
var zip = require('gulp-zip'); | |
var paths = { | |
build: ['**/*.html', '**/*.properties', '**/*.js', '!**/node_modules/**/*'], | |
css: ['**/*.css'], | |
}; | |
gulp.task('zip', function() { | |
return gulp.src(['**/*', '!build/**/*', '!**/node_modules/**/*']) | |
.pipe(zip('./build/app.zip')) | |
.pipe(gulp.dest('.')); | |
}); | |
gulp.task('deploy', ['zip'], function(cb) { | |
deploy('./manifest.webapp', './build/app.zip', cb); | |
}); | |
gulp.task('reloadcss', function(cb) { | |
reloadcss('./manifest.webapp', cb).done(); | |
}); | |
gulp.task('watch', function() { | |
gulp.watch(paths.build, ['deploy']); | |
gulp.watch(paths.css, ['reloadcss']); | |
}); | |
gulp.task('default', ['watch', 'deploy']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Put this in your FirefoxOS folder and install the following