1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

gulp - cleanup comments

This commit is contained in:
kumavis 2017-01-10 13:56:31 -08:00
parent 8e3661555d
commit 074e3f4ab4

View File

@ -35,7 +35,6 @@ var debug = gutil.env.debug
gulp.task('dev:reload', function() { gulp.task('dev:reload', function() {
livereload.listen({ livereload.listen({
port: 35729, port: 35729,
// basePath: './dist/firefox/'
}) })
}) })
@ -262,10 +261,12 @@ function discTask(opts) {
if (opts.watch) { if (opts.watch) {
bundler = watchify(bundler) bundler = watchify(bundler)
bundler.on('update', performBundle) // on any dep update, runs the bundler // on any dep update, runs the bundler
bundler.on('update', performBundle)
} }
bundler.on('log', gutil.log) // output build logs to terminal // output build logs to terminal
bundler.on('log', gutil.log)
return performBundle return performBundle
@ -279,9 +280,6 @@ function discTask(opts) {
bundler.bundle() bundler.bundle()
.pipe(disc()) .pipe(disc())
.pipe(fs.createWriteStream(discPath)) .pipe(fs.createWriteStream(discPath))
// .once('close', function() {
// console.log(`disc: ${opts.label} build completed.`)
// })
) )
} }
} }
@ -292,10 +290,12 @@ function bundleTask(opts) {
if (opts.watch) { if (opts.watch) {
bundler = watchify(bundler) bundler = watchify(bundler)
bundler.on('update', performBundle) // on any dep update, runs the bundler // on any file update, re-runs the bundler
bundler.on('update', performBundle)
} }
bundler.on('log', gutil.log) // output build logs to terminal // output build logs to terminal
bundler.on('log', gutil.log)
return performBundle return performBundle
@ -305,20 +305,26 @@ function bundleTask(opts) {
bundler.bundle() bundler.bundle()
// log errors if they happen // log errors if they happen
.on('error', gutil.log.bind(gutil, 'Browserify Error')) .on('error', gutil.log.bind(gutil, 'Browserify Error'))
// convert bundle stream to gulp vinyl stream
.pipe(source(opts.filename)) .pipe(source(opts.filename))
// gulp-level browserify transforms
.pipe(brfs()) .pipe(brfs())
// inject variables into bundle
.pipe(replace('GULP_TOS_HASH', tosHash)) .pipe(replace('GULP_TOS_HASH', tosHash))
.pipe(replace('\'GULP_METAMASK_DEBUG\'', debug)) .pipe(replace('\'GULP_METAMASK_DEBUG\'', debug))
// optional, remove if you don't need to buffer file contents // buffer file contents (?)
.pipe(buffer()) .pipe(buffer())
// optional, remove if you dont want sourcemaps // sourcemaps
.pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file // loads map from browserify file
// Add transformation tasks to the pipeline here. .pipe(sourcemaps.init({loadMaps: true}))
.pipe(sourcemaps.write('./')) // writes .map file // writes .map file
.pipe(sourcemaps.write('./'))
// write completed bundles
.pipe(gulp.dest('./dist/firefox/scripts')) .pipe(gulp.dest('./dist/firefox/scripts'))
.pipe(gulp.dest('./dist/chrome/scripts')) .pipe(gulp.dest('./dist/chrome/scripts'))
.pipe(gulp.dest('./dist/edge/scripts')) .pipe(gulp.dest('./dist/edge/scripts'))
.pipe(gulp.dest('./dist/opera/scripts')) .pipe(gulp.dest('./dist/opera/scripts'))
// finally, trigger live reload
.pipe(gulpif(!disableLiveReload, livereload())) .pipe(gulpif(!disableLiveReload, livereload()))
) )