aboutsummaryrefslogtreecommitdiffstats
path: root/gulpfile.js
diff options
context:
space:
mode:
authorDan Finlay <somniac@me.com>2016-07-29 02:08:31 +0800
committerGitHub <noreply@github.com>2016-07-29 02:08:31 +0800
commit496b6b6e96c9e23026b862ee36100cb4f56e9c2f (patch)
treeda73e606b2cbf4d5bf271ed0603177496c916c1f /gulpfile.js
parenta259dfad253250edee57c4def80ad799c84ba2db (diff)
parentdaaac17be20faf3f53f3a4b04d70504ebf894568 (diff)
downloadtangerine-wallet-browser-496b6b6e96c9e23026b862ee36100cb4f56e9c2f.tar
tangerine-wallet-browser-496b6b6e96c9e23026b862ee36100cb4f56e9c2f.tar.gz
tangerine-wallet-browser-496b6b6e96c9e23026b862ee36100cb4f56e9c2f.tar.bz2
tangerine-wallet-browser-496b6b6e96c9e23026b862ee36100cb4f56e9c2f.tar.lz
tangerine-wallet-browser-496b6b6e96c9e23026b862ee36100cb4f56e9c2f.tar.xz
tangerine-wallet-browser-496b6b6e96c9e23026b862ee36100cb4f56e9c2f.tar.zst
tangerine-wallet-browser-496b6b6e96c9e23026b862ee36100cb4f56e9c2f.zip
Merge pull request #499 from MetaMask/FixDevScripts
Fix dev tasks for multi browser copying
Diffstat (limited to 'gulpfile.js')
-rw-r--r--gulpfile.js25
1 files changed, 15 insertions, 10 deletions
diff --git a/gulpfile.js b/gulpfile.js
index 0d31eeb5b..96e5e11c7 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -64,7 +64,7 @@ copyTask({
source: './dist/firefox',
destination: './dist/chrome',
}), '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.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
-gulp.task('dev:js:inpage', bundleTask({ watch: true, filename: 'inpage.js' }))
-gulp.task('dev:js:contentscript', bundleTask({ watch: true, filename: 'contentscript.js' }))
-gulp.task('dev:js:background', bundleTask({ watch: true, filename: 'background.js' }))
-gulp.task('dev:js:popup', bundleTask({ watch: true, filename: 'popup.js' }))
-gulp.task('dev:js', gulp.parallel('dev:js:inpage','dev:js:contentscript','dev:js:background','dev:js:popup'))
+const jsFiles = [
+ 'inpage',
+ 'contentscript',
+ '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('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'))
// clean dist
@@ -182,6 +186,7 @@ function bundleTask(opts) {
// Add transformation tasks to the pipeline here.
.pipe(sourcemaps.write('./')) // writes .map file
.pipe(gulp.dest('./dist/firefox/scripts'))
+ .pipe(gulp.dest('./dist/chrome/scripts'))
.pipe(livereload())
)