Is there a clean way to pass custom options for a transformer?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 5.6k
- Forks
- 696
- Avg merge
- 8m
- Merged PRs (30d)
- 7
Description
I have created a couple of custom transformers for React Native (e.g. https://github.com/kristerkari/react-native-css-transformer).
Is there a clean way to add custom options for a transformer? So far I haven't found a way. I could always wrap the transformer and extend the options object, but it would be nice to have a way to do it from rn-cli.config.js.
Currently I can only add the extensions and the module/filename of the transfomer:
module.exports = {
getTransformModulePath() {
return require.resolve("react-native-css-transformer");
},
getSourceExts() {
return ["css"];
}
};
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the rn-cli.config.js entry points getTransformModulePath() and getSourceExts(), then trace how Metro passes configuration to custom transformers. Define completion as allowing transformer-specific options to be supplied from rn-cli.config.js without requiring a wrapper, with coverage for the documented configuration behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100