'use strict'; var browserify = require('browserify'); var source = require('vinyl-source-stream'); var gulp = require('gulp'); var path = require('path'); var del = require('del'); var projectPath = process.argv[2] || process.cwd(); var pebbleJsPath = path.resolve(projectPath, 'src/js/pebble-js-app.js'); var clayJsPath = path.resolve(projectPath, 'src/js/pebble-clay-js-app.js'); var warningMessage = '/* Do not edit this file! Use "pebble-clay-js-app.js" instead. */'; gulp.task('clean', function() { return del([pebbleJsPath]); }); gulp.task('pebble-js-app', ['clean'], function() { browserify(clayJsPath, { debug: false }) .bundle() .pipe(source('pebble-js-app.js')) .pipe(gulp.dest('./src/js/')); }); gulp.start('pebble-js-app');