Styledictionary/4/Hook Api Preprocessors

/icons/calendar.svg

Last update

Jan 10, 2025

What Changed

This codemod updates registered preprocessors to be placed inside the hooks.preprocessors property, instead of preprocessor, with a shift from the singular to the plural form. Registered preprocessors now apply globally without requiring explicit application in the config.

Before

export default {
preprocessors: {
foo: (dictionary) => {
// preprocess it
return dictionary;
},
},
preprocessors: ["foo"],
platforms: {
css: {
preprocessors: ["foo"],
},
},
};

After

export default {
preprocessors: ["foo"],
platforms: {
css: {
preprocessors: ["foo"],
},
},
hooks: {
preprocessors: {
foo: (dictionary) => {
// preprocess it
return dictionary;
},
},
},
};

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now