Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Jul 10, 2023
1 parent 62d8995 commit d7f76b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions build/esbuild-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ function replaceModules(replaceMap, opts = {disableUnusedError: false}) {
*/
function ignoreBuiltins(opts = {}) {
let builtinList = [...builtin];
if (opts.exclude) builtinList = builtinList.filter(b => !opts.exclude.includes(b));
if (opts.exclude) {
builtinList = builtinList.filter(b => !opts?.exclude?.includes(b));
}
const builtinRegexp = new RegExp(`^(${builtinList.join('|')})\\/?(.+)?`);
return {
name: 'ignore-builtins',
Expand Down Expand Up @@ -215,7 +217,7 @@ function generateUMD(iifeCode, moduleName) {
`root.${moduleComponents[0]}.${moduleComponents[1]} = factory();` :
`root.${moduleName} = factory();`;
// TODO: we need to change `Lighthouse.ReportGenerator.ReportGenerator` to `Lighthouse.ReportGenerator` in CDT.
const devtoolsHack = moduleName === 'Lighthouse.ReportGenerator' ?
const devtoolsHack = moduleName === 'Lighthouse.ReportGenerator' ?
'root.Lighthouse.ReportGenerator.ReportGenerator = root.Lighthouse.ReportGenerator;' :
'';

Expand Down

0 comments on commit d7f76b3

Please sign in to comment.