Skip to content

Instantly share code, notes, and snippets.

@nicola
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicola/bf1bd15f53fc6587ad16 to your computer and use it in GitHub Desktop.
Save nicola/bf1bd15f53fc6587ad16 to your computer and use it in GitHub Desktop.
Gulpfile.js to deploy and live-edit css on FirefoxOS
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']);
@nicola
Copy link
Author

nicola commented Aug 26, 2014

Put this in your FirefoxOS folder and install the following

$ npm install --save gulp moz-deploy-b2g moz-reloadcss-b2g gulp-zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment