提取器
提取器用于从源代码中提取实用程序的使用情况。
ts
// uno.config.ts
import { defineConfig } from 'unocss'
export default defineConfig({
extractors: [
// your extractors
],
})
By default extractorSplit will always be applied, which splits the source code into tokens and directly feed to the engine.
覆盖默认的提取器,你可以这样设置extractorDefault
ts
// uno.config.ts
import { defineConfig } from 'unocss'
export default defineConfig({
extractors: [
// your extractors
],
// disable the default extractor
extractorDefault: false,
// override the default extractor with your own
extractorDefault: myExtractor,
})
For example, please check the implementation of pug extractor or the attributify extractor.