build: improve webpack config (#3463)

This commit is contained in:
Alex Yang
2023-07-29 23:34:52 -07:00
committed by GitHub
parent 05865d51c6
commit cc7de52caf
5 changed files with 33 additions and 9 deletions

View File

@@ -0,0 +1,19 @@
import 'ses';
if (!process.env.COVERAGE) {
lockdown({
evalTaming: 'unsafeEval',
overrideTaming: 'severe',
consoleTaming: 'unsafe',
errorTaming: 'unsafe',
errorTrapping: 'platform',
unhandledRejectionTrapping: 'report',
});
console.log('SES lockdown complete');
} else {
Object.defineProperty(globalThis, 'harden', {
value: (x: any) => Object.freeze(x),
writable: false,
});
}