mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Turn off LM scuttling feature for dev builds (#17771)
This commit is contained in:
parent
3678894df2
commit
afed985b48
@ -73,9 +73,17 @@ async function defineAndRunBuildTasks() {
|
|||||||
version,
|
version,
|
||||||
} = await parseArgv();
|
} = await parseArgv();
|
||||||
|
|
||||||
|
// scuttle on production/tests environment only
|
||||||
|
const shouldScuttle = ['dist', 'prod', 'test'].includes(entryTask);
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
`Building lavamoat runtime file`,
|
||||||
|
`(scuttling is ${shouldScuttle ? 'on' : 'off'})`,
|
||||||
|
);
|
||||||
|
|
||||||
// build lavamoat runtime file
|
// build lavamoat runtime file
|
||||||
await lavapack.buildRuntime({
|
await lavapack.buildRuntime({
|
||||||
scuttleGlobalThis: true,
|
scuttleGlobalThis: applyLavaMoat && shouldScuttle,
|
||||||
scuttleGlobalThisExceptions: [
|
scuttleGlobalThisExceptions: [
|
||||||
// globals used by different mm deps outside of lm compartment
|
// globals used by different mm deps outside of lm compartment
|
||||||
'toString',
|
'toString',
|
||||||
|
@ -163,7 +163,7 @@ function wrapAgainstScuttling(content, bag = {}) {
|
|||||||
const proxy = new Proxy(bag, {
|
const proxy = new Proxy(bag, {
|
||||||
set: function set(target, prop, value) {
|
set: function set(target, prop, value) {
|
||||||
if (bag.hasOwnProperty(prop) || prop.startsWith('on')) {
|
if (bag.hasOwnProperty(prop) || prop.startsWith('on')) {
|
||||||
return bag[prop] = global[prop] = value;
|
return (bag[prop] = global[prop] = value) || true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user