Skip to content

Splitting output files

Common questions are:

  • How do I prevent my global/primitive tokens from getting to the output?
  • How do I split and output my component tokens in their respective component folders?

This example will show how you can dynamically generate file outputs for each component, and filter out global/primitive tokens. The trick is to dynamically generate the files array, generate one for each output file you want, and use filters to ensure those outputs only contain the tokens that are relevant.

More information can be found on the filters documentation and files config.