mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
gulp - clean and simplify
This commit is contained in:
parent
af312bdc90
commit
464b7d5814
38
gulpfile.js
38
gulpfile.js
@ -193,26 +193,10 @@ gulp.task('clean', function clean() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// zip tasks for distribution
|
// zip tasks for distribution
|
||||||
gulp.task('zip:chrome', () => {
|
gulp.task('zip:chrome', zipTask('chrome'))
|
||||||
return gulp.src('dist/chrome/**')
|
gulp.task('zip:firefox', zipTask('firefox'))
|
||||||
.pipe(zip(`metamask-chrome-${manifest.version}.zip`))
|
gulp.task('zip:edge', zipTask('edge'))
|
||||||
.pipe(gulp.dest('builds'));
|
gulp.task('zip:opera', zipTask('opera'))
|
||||||
})
|
|
||||||
gulp.task('zip:firefox', () => {
|
|
||||||
return gulp.src('dist/firefox/**')
|
|
||||||
.pipe(zip(`metamask-firefox-${manifest.version}.zip`))
|
|
||||||
.pipe(gulp.dest('builds'));
|
|
||||||
})
|
|
||||||
gulp.task('zip:edge', () => {
|
|
||||||
return gulp.src('dist/edge/**')
|
|
||||||
.pipe(zip(`metamask-edge-${manifest.version}.zip`))
|
|
||||||
.pipe(gulp.dest('builds'));
|
|
||||||
})
|
|
||||||
gulp.task('zip:opera', () => {
|
|
||||||
return gulp.src('dist/opera/**')
|
|
||||||
.pipe(zip(`metamask-opera-${manifest.version}.zip`))
|
|
||||||
.pipe(gulp.dest('builds'));
|
|
||||||
})
|
|
||||||
gulp.task('zip', gulp.parallel('zip:chrome', 'zip:firefox', 'zip:edge', 'zip:opera'))
|
gulp.task('zip', gulp.parallel('zip:chrome', 'zip:firefox', 'zip:edge', 'zip:opera'))
|
||||||
|
|
||||||
// high level tasks
|
// high level tasks
|
||||||
@ -243,15 +227,23 @@ function copyTask(opts){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function zipTask(target) {
|
||||||
|
return () => {
|
||||||
|
return gulp.src(`dist/${target}/**`)
|
||||||
|
.pipe(zip(`metamask-${target}-${manifest.version}.zip`))
|
||||||
|
.pipe(gulp.dest('builds'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function bundleTask(opts) {
|
function bundleTask(opts) {
|
||||||
var browserifyOpts = assign({}, watchify.args, {
|
var browserifyOpts = assign({}, watchify.args, {
|
||||||
entries: ['./app/scripts/'+opts.filename],
|
entries: ['./app/scripts/'+opts.filename],
|
||||||
debug: true,
|
|
||||||
plugin: 'browserify-derequire',
|
plugin: 'browserify-derequire',
|
||||||
|
debug: debug,
|
||||||
|
fullPaths: debug,
|
||||||
})
|
})
|
||||||
|
|
||||||
var bundler = browserify(browserifyOpts)
|
var bundler = browserify(browserifyOpts)
|
||||||
bundler.transform('brfs')
|
|
||||||
if (opts.watch) {
|
if (opts.watch) {
|
||||||
bundler = watchify(bundler)
|
bundler = watchify(bundler)
|
||||||
bundler.on('update', performBundle) // on any dep update, runs the bundler
|
bundler.on('update', performBundle) // on any dep update, runs the bundler
|
||||||
@ -281,7 +273,7 @@ function bundleTask(opts) {
|
|||||||
.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'))
|
||||||
.pipe(gulpif(!disableLiveReload,livereload()))
|
.pipe(gulpif(!disableLiveReload, livereload()))
|
||||||
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,7 @@
|
|||||||
"es2015"
|
"es2015"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"brfs"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
Loading…
Reference in New Issue
Block a user