amzn / style-dictionary

A build system for creating cross-platform styles.
https://styledictionary.com
Apache License 2.0
3.87k stars 543 forks source link

🪲 "exportPlatform" doesn't apply filters #998

Open tgelu opened 1 year ago

tgelu commented 1 year ago

I have a config for a platform which looks like this:

            platforms: {
              css: {
                transforms: CSS_TRANSFORMS,
                files: [
                  {
                    filter: (token) => token.isSource,
                    format: 'css/variables',
                    options: {
                      outputReferences: true,
                    },
                  },
                ],
              },
            },

If I try to use the dictionary using this config and call .exportPlatform('css') I get everything as expected except that the filter doesn't seem to take effect. This is not true if I call buildPlatform('css') which writes to file.