I have a custom preprocessor which I want to run only on a single platform, however I want access to the config via the options param that is passed to the preprocess function. If I specify this preprocessor at the root level, the options param is populated with the config as expected, however, specified on a single platform, the options object is empty. I would expect to get either the full config object or platform configuration, preferably both.
// config.js
{
hooks: {
preprocessors: {
'my-custom-preprocessor': (tokens, options) => {
console.log(options);
}
},
// when specified at the root level, the console statement in the preprocessor function
// will log out this config object as expected 👍
preprocessors: ['my-custom-preprocessor'],
platforms: {
css: {
files: [{ // basic css file }],
transformGroup: 'css',
// when specified on a platform, the console statement only logs an empty object: {} 😢
preprocessors: ['my-custom-preprocessor'],
}
}
}
}
I've tested this in a barebones StyleDictionary project using v4.1.3. Also want to note that it makes no difference whether the preprocessor is defined inline like in the example or registered with registerPreprocessor.
I have a custom preprocessor which I want to run only on a single platform, however I want access to the config via the
options
param that is passed to thepreprocess
function. If I specify this preprocessor at the root level, theoptions
param is populated with the config as expected, however, specified on a single platform, the options object is empty. I would expect to get either the full config object or platform configuration, preferably both.I've tested this in a barebones StyleDictionary project using v4.1.3. Also want to note that it makes no difference whether the preprocessor is defined inline like in the example or registered with
registerPreprocessor
.