Skip to content

Commit

Permalink
Remove bg-libs.js from manifest file for dev builds
Browse files Browse the repository at this point in the history
  • Loading branch information
danjm committed Aug 13, 2019
1 parent 20bc923 commit 9ec437d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,29 @@ gulp.task('manifest:testing', function () {
.pipe(gulp.dest('./dist/', { overwrite: true }))
})

const scriptsToExcludeFromBackgroundDevBuild = {
'bg-libs.js': true,
}

gulp.task('manifest:dev', function () {
return gulp.src([
'./dist/firefox/manifest.json',
'./dist/chrome/manifest.json',
], {base: './dist/'})

.pipe(jsoneditor(function (json) {
const currentBackground = json.background
json.background = {
...json.background,
scripts: json.background.scripts.filter(scriptName => !scriptsToExcludeFromBackgroundDevBuild[scriptName]),
}
json.permissions = [...json.permissions, 'webRequestBlocking']
return json
}))

.pipe(gulp.dest('./dist/', { overwrite: true }))
})

gulp.task('copy',
gulp.series(
gulp.parallel(...copyTaskNames),
Expand All @@ -226,6 +249,7 @@ gulp.task('copy',
gulp.task('dev:copy',
gulp.series(
gulp.parallel(...copyDevTaskNames),
'manifest:dev',
'manifest:chrome',
'manifest:opera'
)
Expand Down

0 comments on commit 9ec437d

Please sign in to comment.