You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the import statement of the example block is inferred/derived from the actual import statement from the *.figma.tsx file. This can be altered to a certain extent through importPaths from figma.config.json.
But it's not flexible enough for more use cases.
For example, the local component file is called Button with a capital "B".
So the import is defined as import { Button } from './Button'.
But the component is distributed as a standalone package named @uikit/button, with a lowercase "b".
Defining an import path like "*": "@uikit/*" will result in import { Button } from '@uikit/Button', with the original capital "B" vs the expected lowercase "b".
The text was updated successfully, but these errors were encountered:
Hey! We added a way to override the import statements in the latest version (It's not yet documented in the README):
figma.connect(Button, "https://...", {
imports: ["import Button from '@acme/ui'"]
})
Keen to hear your thoughts on this - hopefully this helps to unblock you. We'll likely revisit the autogenerated imports too in the future to make them more customizable/flexible to use
Currently, the
import
statement of the example block is inferred/derived from the actualimport
statement from the*.figma.tsx
file. This can be altered to a certain extent throughimportPaths
fromfigma.config.json
.But it's not flexible enough for more use cases.
For example, the local component file is called
Button
with a capital "B".So the import is defined as
import { Button } from './Button'
.But the component is distributed as a standalone package named
@uikit/button
, with a lowercase "b".Defining an import path like
"*": "@uikit/*"
will result inimport { Button } from '@uikit/Button'
, with the original capital "B" vs the expected lowercase "b".The text was updated successfully, but these errors were encountered: