I’m trying to setup my code-connect project very similar to @figma/sds where in the figma.config.json file they’re in a rather clever method of leveraging documentUrlSubstitutions
to do value replacement for the Figma document URL.
Config
{
"codeConnect": {
"include": ["./src/components/**/*.{tsx,jsx}"],
"exclude": ["**/utils/*"],
"parser": "react",
},
"documentUrlSubstitutions": {
"<FIGMA_INPUT>": "https://www.figma.com/design/:file_id_here?node-id=:node_id_here",
}
}
Component:
figma.connect(Input, '<FIGMA_INPUT>', {
// code is here
});
Error:
Validating Code Connect files...
Failed to parse <FIGMA_INPUT>
Any insights or is there a custom implementation I am missing? [details left out for privacy]