Merge pull request #499 from MetaMask/FixDevScripts

Fix dev tasks for multi browser copying
feature/default_network_editable
Dan Finlay 8 years ago committed by GitHub
commit 496b6b6e96
  1. 23
      gulpfile.js

@ -64,7 +64,7 @@ copyTask({
source: './dist/firefox', source: './dist/firefox',
destination: './dist/chrome', destination: './dist/chrome',
}), 'manifest:cleanup')) }), 'manifest:cleanup'))
gulp.task('copy', gulp.series(gulp.parallel('copy:locales','copy:images','copy:fonts','copy:reload','copy:root'), 'copy:chrome')) gulp.task('copy', gulp.parallel('copy:locales','copy:images','copy:fonts','copy:reload','copy:root'))
gulp.task('copy:watch', function(){ gulp.task('copy:watch', function(){
gulp.watch(['./app/{_locales,images}/*', './app/scripts/chromereload.js', './app/*.{html,json}'], gulp.series('copy')) gulp.watch(['./app/{_locales,images}/*', './app/scripts/chromereload.js', './app/*.{html,json}'], gulp.series('copy'))
}) })
@ -91,16 +91,20 @@ gulp.task('default', ['lint'], function () {
// build js // build js
gulp.task('dev:js:inpage', bundleTask({ watch: true, filename: 'inpage.js' })) const jsFiles = [
gulp.task('dev:js:contentscript', bundleTask({ watch: true, filename: 'contentscript.js' })) 'inpage',
gulp.task('dev:js:background', bundleTask({ watch: true, filename: 'background.js' })) 'contentscript',
gulp.task('dev:js:popup', bundleTask({ watch: true, filename: 'popup.js' })) 'background',
'popup',
]
jsFiles.forEach((jsFile) => {
gulp.task(`dev:js:${jsFile}`, bundleTask({ watch: true, filename: `${jsFile}.js` }))
gulp.task(`build:js:${jsFile}`, bundleTask({ watch: false, filename: `${jsFile}.js` }))
})
gulp.task('dev:js', gulp.parallel('dev:js:inpage','dev:js:contentscript','dev:js:background','dev:js:popup')) gulp.task('dev:js', gulp.parallel('dev:js:inpage','dev:js:contentscript','dev:js:background','dev:js:popup'))
gulp.task('build:js:inpage', bundleTask({ watch: false, filename: 'inpage.js' }))
gulp.task('build:js:contentscript', bundleTask({ watch: false, filename: 'contentscript.js' }))
gulp.task('build:js:background', bundleTask({ watch: false, filename: 'background.js' }))
gulp.task('build:js:popup', bundleTask({ watch: false, filename: 'popup.js' }))
gulp.task('build:js', gulp.parallel('build:js:inpage','build:js:contentscript','build:js:background','build:js:popup')) gulp.task('build:js', gulp.parallel('build:js:inpage','build:js:contentscript','build:js:background','build:js:popup'))
// clean dist // clean dist
@ -182,6 +186,7 @@ function bundleTask(opts) {
// Add transformation tasks to the pipeline here. // Add transformation tasks to the pipeline here.
.pipe(sourcemaps.write('./')) // writes .map file .pipe(sourcemaps.write('./')) // writes .map file
.pipe(gulp.dest('./dist/firefox/scripts')) .pipe(gulp.dest('./dist/firefox/scripts'))
.pipe(gulp.dest('./dist/chrome/scripts'))
.pipe(livereload()) .pipe(livereload())
) )

Loading…
Cancel
Save