Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc(build): do not assign runBundledLighthouse in devtools bundle #13311

Merged
merged 8 commits into from
Nov 9, 2021
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;
}