mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
build - properly set GULP_METAMASK_DEBUG on dev
This commit is contained in:
parent
8e0f39353d
commit
80839eebe4
11
gulpfile.js
11
gulpfile.js
@ -16,7 +16,6 @@ const eslint = require('gulp-eslint')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const manifest = require('./app/manifest.json')
|
||||
const gulpif = require('gulp-if')
|
||||
const replace = require('gulp-replace')
|
||||
const mkdirp = require('mkdirp')
|
||||
const asyncEach = require('async/each')
|
||||
@ -31,8 +30,6 @@ const debug = require('gulp-debug')
|
||||
const pify = require('pify')
|
||||
const endOfStream = pify(require('end-of-stream'))
|
||||
|
||||
const disableDebugTools = gutil.env.disableDebugTools
|
||||
const debugMode = gutil.env.debug
|
||||
|
||||
const browserPlatforms = [
|
||||
'firefox',
|
||||
@ -181,12 +178,12 @@ gulp.task('manifest:production', function() {
|
||||
],{base: './dist/'})
|
||||
|
||||
// Exclude chromereload script in production:
|
||||
.pipe(gulpif(!debugMode,jsoneditor(function(json) {
|
||||
.pipe(jsoneditor(function(json) {
|
||||
json.background.scripts = json.background.scripts.filter((script) => {
|
||||
return !script.includes('chromereload')
|
||||
})
|
||||
return json
|
||||
})))
|
||||
}))
|
||||
|
||||
.pipe(gulp.dest('./dist/', { overwrite: true }))
|
||||
})
|
||||
@ -311,6 +308,7 @@ function createTasksForBuildJsExtension({ buildJsFiles, taskPrefix, devMode, bun
|
||||
minifyBuild: !devMode,
|
||||
buildWithFullPaths: devMode,
|
||||
watch: devMode,
|
||||
devMode,
|
||||
}, bundleTaskOpts)
|
||||
createTasksForBuildJs({ rootDir, taskPrefix, bundleTaskOpts, destinations, buildPhase1, buildPhase2 })
|
||||
}
|
||||
@ -326,6 +324,7 @@ function createTasksForBuildJsMascara({ taskPrefix, devMode, bundleTaskOpts = {}
|
||||
minifyBuild: !devMode,
|
||||
buildWithFullPaths: devMode,
|
||||
watch: devMode,
|
||||
devMode,
|
||||
}, bundleTaskOpts)
|
||||
createTasksForBuildJs({ rootDir, taskPrefix, bundleTaskOpts, destinations, buildPhase1 })
|
||||
}
|
||||
@ -541,7 +540,7 @@ function bundleTask(opts) {
|
||||
// convert bundle stream to gulp vinyl stream
|
||||
.pipe(source(opts.filename))
|
||||
// inject variables into bundle
|
||||
.pipe(replace('\'GULP_METAMASK_DEBUG\'', debugMode))
|
||||
.pipe(replace('\'GULP_METAMASK_DEBUG\'', opts.devMode))
|
||||
// buffer file contents (?)
|
||||
.pipe(buffer())
|
||||
|
||||
|
@ -221,7 +221,6 @@
|
||||
"gulp": "github:gulpjs/gulp#6d71a658c61edb3090221579d8f97dbe086ba2ed",
|
||||
"gulp-babel": "^7.0.0",
|
||||
"gulp-eslint": "^4.0.0",
|
||||
"gulp-if": "^2.0.2",
|
||||
"gulp-json-editor": "^2.2.1",
|
||||
"gulp-livereload": "^3.8.1",
|
||||
"gulp-replace": "^0.6.1",
|
||||
|
Loading…
Reference in New Issue
Block a user