GoogleChrome/lighthouse - GitHub

文章推薦指數: 80 %
投票人數:10人

GitHub - GoogleChrome/lighthouse: Automated auditing, performance metrics, ... on Lighthouse, see https://developers.google.com/web/tools/lighthouse/. Skiptocontent {{message}} GoogleChrome / lighthouse Public Notifications Fork 8.5k Star 24.5k Automatedauditing,performancemetrics,andbestpracticesfortheweb. developers.google.com/web/tools/lighthouse/ License Apache-2.0License 24.5k stars 8.5k forks Star Notifications Code Issues 523 Pullrequests 63 Discussions Actions Projects 0 Security Insights More Code Issues Pullrequests Discussions Actions Projects Security Insights Thiscommitdoesnotbelongtoanybranchonthisrepository,andmaybelongtoaforkoutsideoftherepository. master Branches Tags Couldnotloadbranches Nothingtoshow {{refName}} default Couldnotloadtags Nothingtoshow {{refName}} default 366 branches 110 tags Code Latestcommit brendankenny tests:updatecreate-test-traceutility(#13942) … ad60db4 Apr28,2022 tests:updatecreate-test-traceutility(#13942) ad60db4 Gitstats 5,203 commits Files Permalink Failedtoloadlatestcommitinformation. Type Name Latestcommitmessage Committime .github     assets     build     clients     docs     flow-report     lighthouse-cli     lighthouse-core     lighthouse-logger     proto     report     shared     third-party     treemap     types     viewer     .codecov.yml     .cz-config.js     .editorconfig     .eslintignore     .eslintrc.js     .gitattributes     .gitignore     .mailmap     .npmignore     AUTHORS     CODE_OF_CONDUCT.md     CONTRIBUTING.md     LICENSE     build-tracker.config.js     changelog.md     commitlint.config.js     eslint-local-rules.js     jest.config.js     now.json     package.json     readme.md     root.js     tsconfig-all.json     tsconfig-base.json     tsconfig.json     yarn.lock     Viewcode Lighthouse UsingLighthouseinChromeDevTools UsingtheChromeextension UsingtheNodeCLI CLIoptions OutputExamples LifecycleExamples NotesonErrorReporting UsingtheNodemodule Viewingareport OnlineViewer Docs&Recipes Develop Setup Run Tests Docs LighthouseIntegrationsinWebPerfservices LighthouseIntegrationsinnon-WebPerfservices Plugins RelatedProjects FAQ HowdoesLighthousework? Whyistheperformancescoresolow?Itlooksfinetome. Whydoestheperformancescorechangesomuch? CanIconfigurethelighthouserun? HowdoesLighthouseusenetworkthrottling,andhowcanImakeitbetter? Areresultssenttoaremoteserver? HowdoIgetlocalizedLighthouseresultsviatheCLI? HowdoIauthorcustomauditstoextendLighthouse? HowdoIcontribute? readme.md Lighthouse Lighthouseanalyzeswebappsandwebpages,collectingmodernperformancemetricsandinsightsondeveloperbestpractices. UsingLighthouse UsingLighthouseinChromeDevTools UsingtheChromeextension UsingtheNodeCLI CLIoptions UsingtheNodemodule Viewingareport OnlineViewer Docs&Recipes DevelopingLighthouse Setup Run Tests Docs AssociatedProductsandProjects LighthouseIntegrationsinWebPerfservices LighthouseIntegrationsinnon-WebPerfservices Plugins RelatedProjects FAQ HowdoesLighthousework? CanIconfigurethelighthouserun? HowdoesLighthouseusenetworkthrottling,andhowcanImakeitbetter? Areresultssenttoaremoteserver? HowdoIgetlocalizedLighthouseresults? HowdoIauthorcustomauditstoextendLighthouse? HowdoIcontribute? UsingLighthouseinChromeDevTools LighthouseisintegrateddirectlyintotheChromeDevTools,underthe"Lighthouse"panel. Installation:installChrome. Runit:openChromeDevTools,selecttheLighthousepanel,andhit"Generatereport". UsingtheChromeextension TheChromeextensionwasavailablepriortoLighthousebeingavailableinChromeDeveloperTools,andofferssimilarfunctionality. Installation:installtheextensionfromtheChromeWebStore. Runit:followtheextensionquick-startguide. UsingtheNodeCLI TheNodeCLIprovidesthemostflexibilityinhowLighthouserunscanbeconfiguredandreported.Userswhowantmoreadvancedusage,orwanttorunLighthouseinanautomatedfashionshouldusetheNodeCLI. LighthouserequiresNode14LTS(14.x)orlater. Installation: npminstall-glighthouse #oruseyarn: #yarnglobaladdlighthouse Runit:lighthousehttps://airhorner.com/ Bydefault,LighthousewritesthereporttoanHTMLfile.Youcancontroltheoutputformatbypassingflags. CLIoptions $lighthouse--help lighthouse Logging: --verboseDisplaysverboselogging[boolean][default:false] --quietDisplaysnoprogress,debuglogs,orerrors[boolean][default:false] Configuration: --save-assetsSavethetracecontents&devtoolslogstodisk[boolean][default:false] --list-all-auditsPrintsalistofallavailableauditsandexits[boolean][default:false] --list-trace-categoriesPrintsalistofallrequiredtracecategoriesandexits[boolean][default:false] --print-configPrintthenormalizedconfigforthegivenconfigandoptions,thenexit.[boolean][default:false] --additional-trace-categoriesAdditionalcategoriestocapturewiththetrace(comma-delimited).[string] --config-pathThepathtotheconfigJSON. Anexampleconfigfile:lighthouse-core/config/lr-desktop-config.js[string] --presetUseabuilt-inconfiguration. WARNING:Ifthe--config-pathflagisprovided,thispresetwillbeignored.[string][choices:"perf","experimental","desktop"] --chrome-flagsCustomflagstopasstoChrome(space-delimited).Forafulllistofflags,seehttps://bit.ly/chrome-flags Additionally,usetheCHROME_PATHenvironmentvariabletouseaspecificChromebinary.RequiresChromiumversion66.0orlater.Ifomitted,anydetectedChromeCanaryorChromestablewillbeused.[string][default:""] --portTheporttouseforthedebuggingprotocol.Use0forarandomport[number][default:0] --hostnameThehostnametouseforthedebuggingprotocol.[string][default:"localhost"] --form-factorDetermineshowperformancemetricsarescoredandifmobile-onlyauditsareskipped.Fordesktop,--preset=desktopinstead.[string][choices:"mobile","desktop"] --screenEmulationSetsscreenemulationparameters.Seealso--preset.Use--screenEmulation.disabledtodisable.Otherwisesetthese4parametersindividually:--screenEmulation.mobile--screenEmulation.width=360--screenEmulation.height=640--screenEmulation.deviceScaleFactor=2 --emulatedUserAgentSetsuseragentemulation[string] --max-wait-for-loadThetimeout(inmilliseconds)towaitbeforethepageisconsidereddoneloadingandtherunshouldcontinue.WARNING:Veryhighvaluescanleadtolargetracesandinstability[number] --enable-error-reportingEnableserrorreporting,overridinganysavedpreference.--no-enable-error-reportingwilldotheopposite.More:https://github.com/GoogleChrome/lighthouse/blob/master/docs/error-reporting.md[boolean] --gather-mode,-GCollectartifactsfromaconnectedbrowserandsavetodisk.(Artifactsfolderpathmayoptionallybeprovided).Ifaudit-modeisnotalsoenabled,therunwillquitearly. --audit-mode,-AProcesssavedartifactsfromdisk.(Artifactsfolderpathmaybeprovided,otherwisedefaultsto./latest-run/) --only-auditsOnlyrunthespecifiedaudits[array] --only-categoriesOnlyrunthespecifiedcategories.Availablecategories:accessibility,best-practices,performance,pwa,seo[array] --skip-auditsRuneverythingexcepttheseaudits[array] --budget-pathThepathtothebudget.jsonfileforLightWallet.[string] Output: --outputReporterfortheresults,supportsmultiplevalues.choices:"json","html","csv"[array][default:["html"]] --output-pathThefilepathtooutputtheresults.Use'stdout'towritetostdout. IfusingJSONoutput,defaultisstdout. IfusingHTMLorCSVoutput,defaultisafileintheworkingdirectorywithanamebasedonthetestURLanddate. Ifusingmultipleoutputs,--output-pathisappendedwiththestandardextensionforeachoutputtype."reports/my-run"->"reports/my-run.report.html","reports/my-run.report.json",etc. Example:--output-path=./lighthouse-results.html[string] --viewOpenHTMLreportinyourbrowser[boolean][default:false] Options: --versionShowversionnumber[boolean] --helpShowhelp[boolean] --cli-flags-pathThepathtoaJSONfilethatcontainsthedesiredCLIflagstoapply.Flagsspecifiedatthecommandlinewillstilloverridethefile-basedones. --localeThelocale/languagethereportshouldbeformattedin --blocked-url-patternsBlockanynetworkrequeststothespecifiedURLpatterns[array] --disable-storage-resetDisableclearingthebrowsercacheandotherstorageAPIsbeforearun[boolean] --throttling-methodControlsthrottlingmethod[string][choices:"devtools","provided","simulate"] --throttling --throttling.rttMsControlssimulatednetworkRTT(TCPlayer) --throttling.throughputKbpsControlssimulatednetworkdownloadthroughput --throttling.requestLatencyMsControlsemulatednetworkRTT(HTTPlayer) --throttling.downloadThroughputKbpsControlsemulatednetworkdownloadthroughput --throttling.uploadThroughputKbpsControlsemulatednetworkuploadthroughput --throttling.cpuSlowdownMultiplierControlssimulated+emulatedCPUthrottling --extra-headersSetextraHTTPHeaderstopasswithrequest --precomputed-lantern-data-pathPathtothefilewherelanternsimulationdatashouldbereadfrom,overwritingthelanternobservedestimatesforRTTandserverlatency.[string] --lantern-data-output-pathPathtothefilewherelanternsimulationdatashouldbewrittento,canbeusedinafuturerunwiththe`precomputed-lantern-data-path`flag.[string] --pluginsRunthespecifiedplugins[array] --channel[string][default:"cli"] --chrome-ignore-default-flags[boolean][default:false] Examples: lighthouse--viewOpenstheHTMLreportinabrowseraftertheruncompletes lighthouse--config-path=./myconfig.jsRunsLighthousewithyourownconfiguration:customaudits,reportgeneration,etc. lighthouse--output=json--output-path=./report.json--save-assetsSavetrace,screenshots,andnamedJSONreport. lighthouse--screenEmulation.disabled--throttling-method=provided--no-emulatedUserAgentDisabledeviceemulationandallthrottling lighthouse--chrome-flags="--window-size=412,660"LaunchChromewithaspecificwindowsize lighthouse--quiet--chrome-flags="--headless"LaunchHeadlessChrome,turnofflogging lighthouse--extra-headers"{\"Cookie\":\"monster=blue\",\"x-men\":\"wolverine\"}"Stringify'dJSONHTTPHeaderkey/valuepairstosendinrequests lighthouse--extra-headers=./path/to/file.jsonPathtoJSONfileofHTTPHeaderkey/valuepairstosendinrequests lighthouse--only-categories=performance,pwaOnlyrunthespecifiedcategories.Availablecategories:accessibility,best-practices,performance,pwa,seo FormoreinformationonLighthouse,seehttps://developers.google.com/web/tools/lighthouse/. OutputExamples lighthouse #saves`./_.report.html` lighthouse--outputjson #jsonoutputsenttostdout lighthouse--outputhtml--output-path./report.html #saves`./report.html` #NOTE:specifyinganoutputpathwithmultipleformatsignoresyourspecifiedextensionfor*ALL*formats lighthouse--outputjson--outputhtml--output-path./myfile.json #saves`./myfile.report.json`and`./myfile.report.html` lighthouse--outputjson--outputhtml #saves`./_.report.json`and`./_.report.html` lighthouse--output-path=~/mydir/foo.out--save-assets #saves`~/mydir/foo.report.html` #saves`~/mydir/foo-0.trace.json`and`~/mydir/foo-0.devtoolslog.json` lighthouse--output-path=./report.json--outputjson #saves`./report.json` LifecycleExamples YoucanrunasubsetofLighthouse'slifecycleifdesiredviathe--gather-mode(-G)and--audit-mode(-A)CLIflags. lighthousehttp://example.com-G #launchesbrowser,collectsartifacts,savesthemtodisk(in`./latest-run/`)andquits lighthousehttp://example.com-A #skipsbrowserinteraction,loadsartifactsfromdisk(in`./latest-run/`),runsauditsonthem,generatesreport lighthousehttp://example.com-GA #Normalgather+auditrun,butalsosavescollectedartifactstodiskforsubsequent-Aruns. #Youcanoptionallyprovideacustomfolderdestinationto-G/-A/-GA.Withoutavalue,thedefaultwillbe`$PWD/latest-run`. lighthouse-GA=./gmailartifactshttps://gmail.com NotesonErrorReporting ThefirsttimeyouruntheCLIyouwillbepromptedwithamessageaskingyouifLighthousecananonymouslyreportruntimeexceptions.TheLighthouseteamusesthisinformationtodetectnewbugsandavoidregressions.OptingoutwillnotaffectyourabilitytouseLighthouseinanyway.Learnmore. UsingtheNodemodule YoucanalsouseLighthouseprogrammaticallywiththeNodemodule. ReadUsingLighthouseprogrammaticallyforhelpgettingstarted. ReadLighthouseConfigurationtolearnmoreabouttheconfigurationoptionsavailable. Viewingareport LighthousecanproduceareportasJSONorHTML. HTMLreport: OnlineViewer RunningLighthousewiththe--output=jsonflaggeneratesaJSONdumpoftherun. Youcanviewthisreportonlinebyvisitinghttps://googlechrome.github.io/lighthouse/viewer/ anddraggingthefileontotheapp.Youcanalsousethe"Export"buttonfromthe topofanyLighthouseHTMLreportandopenthereportinthe LighthouseViewer. IntheViewer,reportscanbesharedbyclickingtheshareiconinthetop rightcornerandsigningintoGitHub. Note:sharedreportsarestashedasasecretGistinGitHub,underyouraccount. Docs&Recipes Usefuldocumentation,examples,andrecipestogetyoustarted. Docs Dealingwithvariance UsingLighthouseprogrammatically Testingasitewithauthentication DevelopingPlugins MakingaNewAudit Testingonamobiledevice Settingaperformancebudget LighthouseArchitecture Recipes gulp-helpfulforCIintegration Plugin-exampleLighthouseplugin CustomAuditexample-extendLighthouse,runyourownaudits Videos ThesessionfromGoogleI/O2018coversthenewperformanceengine,upcomingLighthouseRESTAPI,andusingtheChromeUXreporttoevaluatereal-userdata. ThesessionfromGoogleI/O2017coversarchitecture,writingcustomaudits, GitHub/Travis/CIintegration,headlessChrome,andmore: clicktowatchthevideo Develop ReadonforthebasicsofhackingonLighthouse.Also,seeContributing fordetailedinformation. Setup #yarnshouldbeinstalledfirst gitclonehttps://github.com/GoogleChrome/lighthouse cdlighthouse yarn yarnbuild-all Run nodelighthouse-clihttp://example.com #append--chrome-flags="--no-sandbox--headless--disable-gpu"ifyourunintoproblemsconnectingtoChrome Gettingstartedtip:node--inspect-brklighthouse-clihttp://example.comtoopenupChromeDevToolsandstep throughtheentireapp.SeeDebuggingNode.jswithChrome DevTools formoreinfo. Tests #lintandtestallfiles yarntest #watchforfilechangesandruntests #Requireshttp://entrproject.org:brewinstallentr yarnwatch ##runlinting,unit,andsmoketestsseparately yarnlint yarnunit yarnsmoke ##runtsccompiler yarntype-check Docs SomeofourdocshaveteststhatrunonlyinCIbydefault.Ifyouendupneedingtomodifyourdocumentation,you'llneedtorunyarnbuild-pack&&yarntest-docslocallytomakesuretheypass. AdditionalDependencies brewinstalljq LighthouseIntegrationsinWebPerfservices ThissectiondetailsservicesthathaveintegratedLighthousedata.Ifyou'reworkingonacoolprojectintegratingLighthouseandwouldliketobefeaturedhere,fileanissuetothisrepoortweetatus@_____lighthouse! WebPageTest—Anopensourcetoolformeasuringandanalyzingtheperformanceofwebpagesonrealdevices.UserscanchoosetoproduceaLighthousereportalongsidetheanalysisofWebPageTestresults. HTTPArchive-HTTPArchivetrackshowthewebisbuiltbycrawling500kpageswithWebPageTest,includingLighthouseresults,andstorestheinformationinBigQuerywhereitispubliclyavailable. Calibre-CalibreisacomprehensiveperformancemonitoringplatformrunningonLighthouse.SeetheperformanceimpactofyourworkbeforeithitsproductionwithGitHubPullRequestReviews.TracktheimpactofThirdPartyscripts.Automateyourperformancesystemwithadeveloper-firstNode.jsAPI.TryCalibrewithafree15-daytrial. DebugBear-DebugBearisawebsitemonitoringtoolbasedonLighthouse.Seehowyourscoresandmetricschangedovertime,withafocusonunderstandingwhatcausedeachchange.DebugBearisapaidproductwithafree30-daytrial. Treo-TreoisLighthouseasaService.Itprovidesregressiontesting,geographicalregions,customnetworks,andintegrationswithGitHub&Slack.Treoisapaidproductwithplansforsolo-developersandteams. Alertdesk-AlertdeskisbasedonLighthouseandhelpsyoutokeeptrackofyoursite’squality&performance.Rundailyquality&performancetestsfrombothMobileandDesktopanddiveintothepowerful&intuitivereports.Youcanalsomonitoryouruptime(everyminute-24/7)&domainhealth.Alertdeskisapaidproductwithafree14-daytrial. Screpy-Screpyisawebanalysistoolthatcananalyzeallpagesofyourwebsitesinonedashboardandmonitorthemwithyourteam.It'spoweredbyLighthouseanditalsoincludessomedifferentanalysistools(SERP,W3C,Uptime,etc).Screpyhasfreeandpaidplans. LighthouseKeeper-LighthouseKeepermonitorsyourpages'Lighthousescoresandnotifiesyouiftheydropbelowyourthresholds.LighthouseKeeperisafreeservicethatmonitorsupto3URLsonceperday. SiteimprovePerformance—SiteimprovePerformanceisawebPerformancemonitoringsolutionthatenablesamarketer,managerordecisionmakertounderstandandoptimizewebsiteloadtimes.Geteasy-to-useinsightswithafocusonquickandimpactfulwins.SiteimprovePerformanceisapaidproductwithafree14-daytrial. SpeedCurve—SpeedCurveisatoolforcontinuouslymonitoringwebperformanceacrossdifferentbrowsers,devices,andregions.ItcanaggregateanymetricincludingLighthousescoresacrossmultiplepagesandsites,andallowsyoutosetperformancebudgetswithSlackoremailalerts.SpeedCurveisapaidproductwithafree30-daytrial. Speedrank-Speedrankmonitorstheperformanceofyourwebsiteinthebackground.ItdisplaysLighthousereportsovertimeanddeliversrecommendationsforimprovement.Speedrankisapaidproductwith14-day-trial. Foo-Lighthouse-as-a-serviceofferingfreeandpremiumplans.ProvidesmonitoringandhistoricalreportingofLighthouseauditswithCircleCI,GitHub,andotherintegrations.FeaturesincludeSlacknotifications,PRcommentreportingandmore. Apdex-Apdexisawebsiteperformanceservice.ThemainfeaturesarehistoricalLighthousereportvisualizations,mobile/desktopoptions,alerts,uptimemonitoring,andmore.Thereareflexiblepaidplansanda30-dayfreetrial. Websu-WebsuisanopensourceprojecttoprovideLighthouse-as-a-ServicethroughasimpleHTTPRESTAPI.ThemainfeaturesareabilitytohostanddeployinyourownenvironmentandhistoricalLighthousereportsummaries. DTEKT.IO-DTEKTisawebsiteperformanceanduptimemonitoringservice.Ituseslighthousetoprovidevisibilityintotheperformanceofwebsitesfrommultiplelocationsonmultipledevices.Itoffersthreemonthsfreetrialandpaidplans. SpeedVitals-SpeedVitalsisaLighthousepoweredtooltomeasurewebperformanceacrossmultipledevicesandlocations.IthasvariousfeatureslikeLayoutShiftVisualization,WaterfallChart,FieldDataandResourceGraphs.SpeedVitalsoffersbothfreeandpaidplans. LighthouseIntegrationsinnon-WebPerfservices PageWatch—PageWatchisatooltofindproblempagesonyourwebsite.Itprovidesinsightsintospellingerrors,layoutissues,slowpages(poweredbyLighthouse)andmore.PageWatchisofferedviafreeandpaidplans. SEOGuard—SEOGuardisawebsitemonitoringsolution.ItprovidesmetricsbasedonLighthousescores.Theserviceisofferedviafreeandpaidpremiumplans. Fluxguard-FluxguardprovideswebsiteDOMchangemonitoringorchestratedwithGooglePuppeteer,andauditedbyLighthouse.Fluxguardisafreemiumproduct,withmonthlymonitoringofupto75pagesforfree. Microlink—MicrolinkisacloudbrowserasAPI.ItoffersLighthousereportsondemand,makingiteasytobuildanyserviceontop.Similarfunctionalityisavailableviatheunderlyingopen-sourceprojectnamedbrowserless. Peyk-Peykisawebsitechangedetection&monitoringservice.Peykcandetectchangesincookies,networkrequests,technologies,local&sessionstorage,lighthouseaudits,screenshotsandsomuchmore.Peykisofferedviafreeandpaidplans. Wattspeed—Wattspeedisafreetoolthatgeneratessnapshots-historicalcapturesofyourwebpagesthatincludeLighthousescores,alistoftechnologies,W3CHTMLvalidatorresults,DOMsize,mixedcontentinfo,andmore. AwesomeTechStack—AwesomeTechStackisafreetousewebsitetechstackanalyzer.AwesomeTechStackprovidesinsightsintothesecurity,modernity,andperformanceofanywebsite'stechnologystackandguidancetoimproveperformance.Lighthouseinsightsareacrucialpartofawebsite'stechstackrating. Plugins lighthouse-plugin-field-performance-apluginthataddsreal-userperformancemetricsfortheURLusingthedatafromChromeUXReport. lighthouse-plugin-publisher-ads-atooltoimproveadspeedandoverallqualitythroughaseriesofautomatedaudits.Atthemoment,thisisprimarilytargetedatsitesusingGoogleAdManager.Thistoolwillaidinresolvingdiscoveredproblems,providingatooltobeusedtoevaluateeffectivenessofiterativechangeswhilesuggestingactionablefeedback. lighthouse-plugin-crux-apluginthatquicklygathersreal-user-metricsdatafromtheChromeUXReportAPI. RelatedProjects OtherawesomeopensourceprojectsthatuseLighthouse. auto-lighthouse-aCLIforcrawlingadomainandgeneratingmobileanddesktopreportsforeachpage. Exthouse-Analyzetheimpactofabrowserextensiononwebperformance. Garie-AnopensourcetoolformonitoringperformanceusingLighthouse,PageSpeedInsights,Prometheus,GrafanaandDocker. Gimbal-Anopensource(MITlicensed)toolusedtomeasure,analyze,andbudgetaspectsofawebapplication.GimbalalsointegratesreportswithGitHubpullrequests. GradleLighthousePlugin-AnopensourceGradlepluginthatrunsLighthousetestsonmultipleURLsandassertscategoryscorethresholds(usefulincontinuousintegration). lightcrawler-CrawlawebsiteandruneachpagefoundthroughLighthouse. lighthouse-badges-Generategh-badges(shields.io)basedonLighthouseperformance. lighthouse-batch-RunLighthouseoveranumberofsitesandgenerateasummaryoftheirmetrics/scores. lighthouse-batch-parallel-RunmultipleLighthouserunsinparalleltoacceleratethedatacollectingprocess,gettheresultstream(csv,json,jsobject)inyourownprocess(warning:performanceresultsmaybevolatile). lighthouse-check-action-AGitHubActiontorunLighthouseinaworkflow,featuringSlacknotificationsandreportuploadtoS3. lighthouse-check-orb-ACircleCIOrbtorunLighthouseinaworkflow,featuringSlacknotificationsandreportuploadtoS3. andreasonny83/lighthouse-ci-RunLighthouseandassertscoressatisfyyourcustomthresholds. GoogleChrome/lighthouse-ci-(official)AutomaterunningLighthouseforeverycommit,viewingthechanges,andpreventingregressions. lighthouse-ci-action-AGitHubActionthatmakesiteasytorunLighthouseinCIandkeepyourpagessmallusingperformancebudgets. lighthouse-cron-CronmultiplebatchLighthouseauditsandemitresultsforsendingtoremoteserver. lighthouse-gh-reporter-RunLighthouseinCIandreportbackinacommentonyourpullrequests lighthouse-hue-SetthecolorofPhilipsHuelightsbasedonaLighthousescore lighthouse-jest-example-GatherperformancemetricsviaLighthouseandassertresultswithJest;usesPuppeteertostartChromewithnetworkemulationsettingsdefinedbyWebPageTest. lighthouse-lambda-RunLighthouseonAWSLambdawithprebuiltstabledesktopHeadlessChrome. lighthouse-magic-light-SetthecoloroftheMagicLightBluetoothSmartLightBulbbasedonLighthousescore lighthouse-mocha-example-RunLighthouseperformancetestswithMochaandchrome-launcher. lighthouse-monitor-RunLighthouseagainstallyourURLs.Sendmetricstoanybackendyouwant,saveallreportswithautomaticdataretention,andcompareanytworesultsinawebUI. lighthouse-persist-RunLighthouseanduploadHTMLreportstoanAWSS3bucket. lighthouse-viewer-RendertheLighthouseJSONintoareport,usingtheLighthouseReportRendererrepackagedasUMDandESM.AlsoavailablewithReact,SvelteandVuewrappers. lighthouse4u-LH4UprovidesGoogleLighthouseasaservice,surfacedbybothafriendlyUI+API,andbackedbyElasticSearchforeasyqueryingandvisualization. performance-budgets-EasilyassertLighthousebudgetswithDocker. pwmetrics-Gatherperformancemetrics react-lighthouse-viewer-RenderaLighthouseJSONreportinaReactComponent. site-audit-seo-CLItoolforSEOsiteaudit,crawlsite,lighthouseeachpage.Outputtoconsoleandtablesincsv,xlsx,json,weborGoogleDrive. webpack-lighthouse-plugin-RunLighthousefromaWebpackbuild. is-website-vulnerable-AnopensourceNode.jsCLItoolthatfindspubliclyknownsecurityvulnerabilitiesinawebsite'sfrontendJavaScriptlibraries. cypress-audit-RunLighthouseandPa11yauditsdirectlyinyourE2Etestsuites. FAQ HowdoesLighthousework? SeeLighthouseArchitecture. Whyistheperformancescoresolow?Itlooksfinetome. Lighthousereportstheperformancemetricsastheywouldbeexperiencedbyatypicalmobileuserona4Gconnectionandamid-tier~$200phone.Evenifitloadsquicklyonyourdeviceandnetwork,usersinotherenvironmentswillexperiencethesiteverydifferently. Readmoreinourguidetothrottling. Whydoestheperformancescorechangesomuch? Lighthouseperformancescoreswillchangeduetoinherentvariabilityinwebandnetworktechnologies,eveniftherehasn'tbeenacodechange.Testinconsistentenvironments,runLighthousemultipletimes,andbewareofvariabilitybeforedrawingconclusionsaboutaperformance-impactingchange. Readmoreinourguidetoreducingvariability. CanIconfigurethelighthouserun? Yes!DetailsinLighthouseconfiguration. HowdoesLighthouseusenetworkthrottling,andhowcanImakeitbetter? Goodquestion.NetworkandCPUthrottlingareappliedbydefaultinaLighthouserun.Thenetwork attemptstoemulateslow4GconnectivityandtheCPUissloweddown4xfromyourmachine'sdefaultspeed.Ifyou prefertorunLighthousewithoutthrottling,you'llhavetousetheCLIanddisableitwiththe --throttling.*flagsmentionedabove. Readmoreinourguidetonetworkthrottling. Areresultssenttoaremoteserver? Nope.Lighthouserunslocally,auditingapageusingalocalversionoftheChromebrowserinstalledonthe machine.Reportresultsareneverprocessedorbeaconedtoaremoteserver. HowdoIgetlocalizedLighthouseresultsviatheCLI? StartinginLighthouse8.0,LighthousereliesentirelyonnativeIntlsupportandnolongerusesanIntlpolyfill.Ifyou'reusingNode14orlater,thereshouldbenoissuebecauseNodeisnowbuiltwithfull-icubydefault. However,ifyou'reusingasmall-icuNodebuild,youmayseeLighthouselogmessagesaboutyourlocalenotbeingavailable.Toremedythis,youcanupgradetoNode14+ormanuallyinstallICUdatabyusingthefull-icumoduleandthe--icu-data-dirnodeflagatlaunch. HowdoIauthorcustomauditstoextendLighthouse? Tip:seeLighthouseArchitectureformoreinformation onterminologyandarchitecture. Lighthousecanbeextendedtoruncustomauditsandgatherersthatyouauthor. Thisisgreatifyou'realreadytrackingperformancemetricsinyoursiteand wanttosurfacethosemetricswithinaLighthousereport. Ifyou'reinterestedinrunningyourowncustomaudits,checkoutour CustomAuditExampleoverinrecipes. HowdoIcontribute? We'dlovehelpwritingaudits,fixingbugs,andmakingthetoolmoreuseful! SeeContributingtogetstarted. Lighthouse,ˈlītˌhous(n):atowerorotherstructuretoolcontainingabeaconlight towarnorguideshipsatseadevelopers. About Automatedauditing,performancemetrics,andbestpracticesfortheweb. developers.google.com/web/tools/lighthouse/ Topics web pwa chrome-devtools best-practices audit performance-metrics developer-tools performance-analysis Resources Readme License Apache-2.0License Codeofconduct Codeofconduct Stars 24.5k stars Watchers 563 watching Forks 8.5k forks Releases 84 v9.5.0 Latest Mar10,2022 +83releases Packages0 Nopackagespublished Contributors308 +297contributors Languages JavaScript 95.0% TypeScript 1.9% Shell 1.3% HTML 1.1% CSS 0.6% Handlebars 0.1% Youcan’tperformthatactionatthistime. Yousignedinwithanothertaborwindow.Reloadtorefreshyoursession. Yousignedoutinanothertaborwindow.Reloadtorefreshyoursession.



請為這篇文章評分?