|
|
@ -74,12 +74,7 @@ function createScriptTasks({ browserPlatforms, livereload }) { |
|
|
|
return { dev, test, testDev, prod }; |
|
|
|
return { dev, test, testDev, prod }; |
|
|
|
|
|
|
|
|
|
|
|
function createTasksForBuildJsExtension({ taskPrefix, devMode, testing }) { |
|
|
|
function createTasksForBuildJsExtension({ taskPrefix, devMode, testing }) { |
|
|
|
const standardEntryPoints = [ |
|
|
|
const standardEntryPoints = ['background', 'ui', 'content-script']; |
|
|
|
'background', |
|
|
|
|
|
|
|
'ui', |
|
|
|
|
|
|
|
'phishing-detect', |
|
|
|
|
|
|
|
'content-script', |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
const standardSubtask = createTask( |
|
|
|
const standardSubtask = createTask( |
|
|
|
`${taskPrefix}:standardEntryPoints`, |
|
|
|
`${taskPrefix}:standardEntryPoints`, |
|
|
|
createFactoredBuild({ |
|
|
|
createFactoredBuild({ |
|
|
@ -114,6 +109,11 @@ function createScriptTasks({ browserPlatforms, livereload }) { |
|
|
|
createTaskForBundleSentry({ devMode }), |
|
|
|
createTaskForBundleSentry({ devMode }), |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const phishingDetectSubtask = createTask( |
|
|
|
|
|
|
|
`${taskPrefix}:phishing-detect`, |
|
|
|
|
|
|
|
createTaskForBundlePhishingDetect({ devMode }), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// task for initiating browser livereload
|
|
|
|
// task for initiating browser livereload
|
|
|
|
const initiateLiveReload = async () => { |
|
|
|
const initiateLiveReload = async () => { |
|
|
|
if (devMode) { |
|
|
|
if (devMode) { |
|
|
@ -136,6 +136,7 @@ function createScriptTasks({ browserPlatforms, livereload }) { |
|
|
|
contentscriptSubtask, |
|
|
|
contentscriptSubtask, |
|
|
|
disableConsoleSubtask, |
|
|
|
disableConsoleSubtask, |
|
|
|
installSentrySubtask, |
|
|
|
installSentrySubtask, |
|
|
|
|
|
|
|
phishingDetectSubtask, |
|
|
|
].map((subtask) => runInChildProcess(subtask)); |
|
|
|
].map((subtask) => runInChildProcess(subtask)); |
|
|
|
// make a parent task that runs each task in a child thread
|
|
|
|
// make a parent task that runs each task in a child thread
|
|
|
|
return composeParallel(initiateLiveReload, ...allSubtasks); |
|
|
|
return composeParallel(initiateLiveReload, ...allSubtasks); |
|
|
@ -163,6 +164,17 @@ function createScriptTasks({ browserPlatforms, livereload }) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function createTaskForBundlePhishingDetect({ devMode }) { |
|
|
|
|
|
|
|
const label = 'phishing-detect'; |
|
|
|
|
|
|
|
return createNormalBundle({ |
|
|
|
|
|
|
|
label, |
|
|
|
|
|
|
|
entryFilepath: `./app/scripts/${label}.js`, |
|
|
|
|
|
|
|
destFilepath: `${label}.js`, |
|
|
|
|
|
|
|
devMode, |
|
|
|
|
|
|
|
browserPlatforms, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// the "contentscript" bundle contains the "inpage" bundle
|
|
|
|
// the "contentscript" bundle contains the "inpage" bundle
|
|
|
|
function createTaskForBundleContentscript({ devMode, testing }) { |
|
|
|
function createTaskForBundleContentscript({ devMode, testing }) { |
|
|
|
const inpage = 'inpage'; |
|
|
|
const inpage = 'inpage'; |
|
|
@ -277,10 +289,6 @@ function createFactoredBuild({ |
|
|
|
renderHtmlFile('home', groupSet, commonSet, browserPlatforms); |
|
|
|
renderHtmlFile('home', groupSet, commonSet, browserPlatforms); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
case 'phishing-detect': { |
|
|
|
|
|
|
|
renderHtmlFile('phishing', groupSet, commonSet, browserPlatforms); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
case 'background': { |
|
|
|
case 'background': { |
|
|
|
renderHtmlFile('background', groupSet, commonSet, browserPlatforms); |
|
|
|
renderHtmlFile('background', groupSet, commonSet, browserPlatforms); |
|
|
|
break; |
|
|
|
break; |
|
|
|