Skip to content

Commit

Permalink
Adding trezor script/html to standardSubtask (build system) (MetaMask…
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanml committed Aug 18, 2021
1 parent ddae14d commit cfac223
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions development/build/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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}"`);
}
Expand Down

0 comments on commit cfac223

Please sign in to comment.