Start the development server, with hot reloading:
npm run dev
The examples images used on this site are maintained in this Figma project.
There is a script that extracts the images and stores them in
the static folder. Then you can refer them then using <img>
tags with relative paths.
Whenever a Github build runs, the import script will be run and the imported files will then be included in the final
docs build. For local development, run the npm run import
script as needed. You will need a Figma token to do so as
described in the following section.
If you are running the import script for the first time, it will prompt your for a Figma access token. The token is is required to access Figma's API. It can be generated on your Figma account settings page.
The import script may store the token to a local file, so you won't have to supply the token again on subsequent runs.
To update the images, run the following script. If it has a valid Figma access token (see above), it will proceed to
download all the image files into the public/figma
folder
npm run import
If the scripts authentication issues, you could try to create a new access token and delete the local file
.FIGMA_TOKEN
before running the script again.
The script is probably not resilient to changes in the structure of the Figma project. Changes there will probably require an update of the import script.