mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix browser specific manifest generation (#13007)
This commit is contained in:
parent
1794ee8b72
commit
7dac6f2517
@ -1,6 +1,6 @@
|
|||||||
const { promises: fs } = require('fs');
|
const { promises: fs } = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const { merge, cloneDeep } = require('lodash');
|
const { mergeWith, cloneDeep } = require('lodash');
|
||||||
|
|
||||||
const baseManifest = require('../../app/manifest/_base.json');
|
const baseManifest = require('../../app/manifest/_base.json');
|
||||||
|
|
||||||
@ -28,11 +28,12 @@ function createManifestTasks({
|
|||||||
`${platform}.json`,
|
`${platform}.json`,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
const result = merge(
|
const result = mergeWith(
|
||||||
cloneDeep(baseManifest),
|
cloneDeep(baseManifest),
|
||||||
platformModifications,
|
platformModifications,
|
||||||
browserVersionMap[platform],
|
browserVersionMap[platform],
|
||||||
await getBuildModifications(buildType, platform),
|
await getBuildModifications(buildType, platform),
|
||||||
|
customArrayMerge,
|
||||||
);
|
);
|
||||||
const dir = path.join('.', 'dist', platform);
|
const dir = path.join('.', 'dist', platform);
|
||||||
await fs.mkdir(dir, { recursive: true });
|
await fs.mkdir(dir, { recursive: true });
|
||||||
@ -99,6 +100,14 @@ function createManifestTasks({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// helper for merging obj value
|
||||||
|
function customArrayMerge(objValue, srcValue) {
|
||||||
|
if (Array.isArray(objValue)) {
|
||||||
|
return [...new Set([...objValue, ...srcValue])];
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// helper for reading and deserializing json from fs
|
// helper for reading and deserializing json from fs
|
||||||
|
Loading…
Reference in New Issue
Block a user