1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Adding trezor script/html to standardSubtask (build system) (#11874)

This commit is contained in:
ryanml 2021-08-18 04:26:44 -07:00
parent ddae14dab9
commit cfac223fe8

View File

@ -74,13 +74,21 @@ function createScriptTasks({ browserPlatforms, livereload }) {
return { dev, test, testDev, prod };
function createTasksForBuildJsExtension({ taskPrefix, devMode, testing }) {
const standardEntryPoints = ['background', 'ui', 'phishing-detect'];
const standardEntryPoints = [
'background',
'ui',
'phishing-detect',
'content-script',
];
const standardSubtask = createTask(
`${taskPrefix}:standardEntryPoints`,
createFactoredBuild({
entryFiles: standardEntryPoints.map(
(label) => `./app/scripts/${label}.js`,
),
entryFiles: standardEntryPoints.map((label) => {
if (label === 'content-script') {
return './app/vendor/trezor/content-script.js';
}
return `./app/scripts/${label}.js`;
}),
devMode,
testing,
browserPlatforms,
@ -277,6 +285,15 @@ function createFactoredBuild({
renderHtmlFile('background', groupSet, commonSet, browserPlatforms);
break;
}
case 'content-script': {
renderHtmlFile(
'trezor-usb-permissions',
groupSet,
commonSet,
browserPlatforms,
);
break;
}
default: {
throw new Error(`buildsys - unknown groupLabel "${groupLabel}"`);
}