Skip to main content
Solved

Show different *.html files


GiroXIII

I’d like to show different html files based on the selected mode & command.

We have the figma.showUI(html: string) function, and the __html__ variable, which contains the default ui.html file content.
Since the function accepts any string, I tried to load another html file as string so I can pass it as parameter, but I am not succeeding in importing the file.

How can I import other html files as string in Typescript?

My goal is to have different html files and show the proper one each time, instead of having a big ui.html file with every UI combination.

I’m using webpack.

Best answer by tank666

@GiroXIII,

View original
This topic has been closed for replies.

2 replies

tank666
  • 4873 replies
  • Answer
  • March 21, 2024

@GiroXIII,


GiroXIII
  • Author
  • 3 replies
  • March 22, 2024

Great! thanks @tank666


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings