Skip to content

提取器

提取器用於從源代碼中提取實用程序的使用情況。

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.

Released under the MIT License.