Skip to content

Commit

Permalink
fix(config): ensure config.lighthouseOptions.onlyCategories tab order
Browse files Browse the repository at this point in the history
  • Loading branch information
zZeepo authored Apr 29, 2023
1 parent 6edd529 commit a8c776c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/core/src/resolveConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,16 @@ export const resolveUserConfig: (userConfig: UserConfig) => Promise<ResolvedUser
// normalise site
config.site = normaliseHost(config.site)
}
if (!config.lighthouseOptions)
if (config.lighthouseOptions) {
if (config.lighthouseOptions.onlyCategories?.length) {
// restrict categories values and copy order of columns from the default config
// @ts-ignore 'defaultConfig.lighthouseOptions' is always set in default config
config.lighthouseOptions.onlyCategories = defaultConfig.lighthouseOptions.onlyCategories
.filter(column => config.lighthouseOptions.onlyCategories.includes(column))
}
} else {
config.lighthouseOptions = {}
}
// for local urls we disable throttling
if (!config.site || config.site.includes('localhost') || !config.scanner?.throttle) {
config.lighthouseOptions.throttlingMethod = 'provided'
Expand Down

0 comments on commit a8c776c

Please sign in to comment.