Skip to content

Commit

Permalink
feat(core): preset support blocklist (#3363)
Browse files Browse the repository at this point in the history
  • Loading branch information
chizukicn committed Nov 21, 2023
1 parent 49b3451 commit 1ce6838
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export function resolveConfig<Theme extends object = object>(

const layers = Object.assign({}, DEFAULT_LAYERS, ...sources.map(i => i.layers))

function getMerged<T extends 'rules' | 'variants' | 'extractors' | 'shortcuts' | 'preflights' | 'preprocess' | 'postprocess' | 'extendTheme' | 'safelist' | 'separators'>(key: T): ToArray<Required<UserConfig<Theme>>[T]> {
function getMerged<T extends 'rules' | 'blocklist' | 'variants' | 'extractors' | 'shortcuts' | 'preflights' | 'preprocess' | 'postprocess' | 'extendTheme' | 'safelist' | 'separators'>(key: T): ToArray<Required<UserConfig<Theme>>[T]> {
return uniq(sources.flatMap(p => toArray(p[key] || []) as any[])) as any
}

Expand Down Expand Up @@ -139,9 +139,9 @@ export function resolveConfig<Theme extends object = object>(
const resolved: ResolvedConfig<any> = {
mergeSelectors: true,
warn: true,
blocklist: [],
sortLayers: layers => layers,
...config,
blocklist: getMerged('blocklist'),
presets: sortedPresets,
envMode: config.envMode || 'build',
shortcutsLayer: config.shortcutsLayer || 'shortcuts',
Expand Down

0 comments on commit 1ce6838

Please sign in to comment.