1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00

build - dev - run js tasks in parallel and set watch flag

This commit is contained in:
kumavis 2018-03-29 17:34:30 -07:00
parent b49ad750dd
commit 7067f63627

View File

@ -254,6 +254,7 @@ function createTasksForBuildJsExtension({ buildJsFiles, taskPrefix, devMode, bun
sourceMapDir: devMode ? './' : '../sourcemaps', sourceMapDir: devMode ? './' : '../sourcemaps',
minifyBuild: !devMode, minifyBuild: !devMode,
buildWithFullPaths: devMode, buildWithFullPaths: devMode,
watch: devMode,
}, bundleTaskOpts) }, bundleTaskOpts)
createTasksForBuildJs({ rootDir, taskPrefix, bundleTaskOpts, destinations, buildPhase1, buildPhase2 }) createTasksForBuildJs({ rootDir, taskPrefix, bundleTaskOpts, destinations, buildPhase1, buildPhase2 })
} }
@ -268,6 +269,7 @@ function createTasksForBuildJsMascara({ taskPrefix, devMode, bundleTaskOpts = {}
sourceMapDir: './', sourceMapDir: './',
minifyBuild: !devMode, minifyBuild: !devMode,
buildWithFullPaths: devMode, buildWithFullPaths: devMode,
watch: devMode,
}, bundleTaskOpts) }, bundleTaskOpts)
createTasksForBuildJs({ rootDir, taskPrefix, bundleTaskOpts, destinations, buildPhase1 }) createTasksForBuildJs({ rootDir, taskPrefix, bundleTaskOpts, destinations, buildPhase1 })
} }
@ -277,7 +279,6 @@ function createTasksForBuildJs({ rootDir, taskPrefix, bundleTaskOpts, destinatio
const jsFiles = [].concat(buildPhase1, buildPhase2) const jsFiles = [].concat(buildPhase1, buildPhase2)
jsFiles.forEach((jsFile) => { jsFiles.forEach((jsFile) => {
gulp.task(`${taskPrefix}:${jsFile}`, bundleTask(Object.assign({ gulp.task(`${taskPrefix}:${jsFile}`, bundleTask(Object.assign({
watch: false,
label: jsFile, label: jsFile,
filename: `${jsFile}.js`, filename: `${jsFile}.js`,
filepath: `${rootDir}/${jsFile}.js`, filepath: `${rootDir}/${jsFile}.js`,
@ -289,7 +290,7 @@ function createTasksForBuildJs({ rootDir, taskPrefix, bundleTaskOpts, destinatio
subtasks.push(gulp.parallel(buildPhase1.map(file => `${taskPrefix}:${file}`))) subtasks.push(gulp.parallel(buildPhase1.map(file => `${taskPrefix}:${file}`)))
if (buildPhase2.length) subtasks.push(gulp.parallel(buildPhase2.map(file => `${taskPrefix}:${file}`))) if (buildPhase2.length) subtasks.push(gulp.parallel(buildPhase2.map(file => `${taskPrefix}:${file}`)))
gulp.task(taskPrefix, gulp.series(subtasks)) gulp.task(taskPrefix, gulp.parallel(subtasks))
} }
// disc bundle analyzer tasks // disc bundle analyzer tasks
@ -324,9 +325,9 @@ gulp.task('apply-prod-environment', function(done) {
gulp.task('dev', gulp.task('dev',
gulp.series( gulp.series(
'build:scss', 'build:scss',
'dev:js',
'copy', 'copy',
gulp.parallel( gulp.parallel(
'dev:js',
'watch:scss', 'watch:scss',
'copy:dev', 'copy:dev',
'dev:reload' 'dev:reload'