Skip to content

Commit

Permalink
misc(build): do not assign runBundledLighthouse in devtools bundle (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark authored Nov 9, 2021
1 parent 423bd62 commit 0dc1b4f
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions clients/devtools-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,6 @@ function lookupCanonicalLocale(locales) {
return lookupLocale(locales, getCanonicalLocales());
}

// For the bundle smoke test.
if (typeof module !== 'undefined' && module.exports) {
// Ideally this could be exposed via browserify's `standalone`, but it doesn't
// work for LH because of https://github.com/browserify/browserify/issues/968
// Instead, since this file is only ever run in node for testing, expose a
// bundle entry point as global.
// @ts-expect-error
global.runBundledLighthouse = lighthouse;
}

// Expose only in DevTools' worker
if (typeof self !== 'undefined') {
// TODO: refactor and delete `global.isDevtools`.
Expand All @@ -106,4 +96,8 @@ if (typeof self !== 'undefined') {
// TODO: expose as lookupCanonicalLocale in LighthouseService.ts?
// @ts-expect-error
self.lookupLocale = lookupCanonicalLocale;
} else {
// For the bundle smoke test.
// @ts-expect-error
global.runBundledLighthouse = lighthouse;
}

0 comments on commit 0dc1b4f

Please sign in to comment.