Importing in code.ts throws error

I am new to writing Figma plugins, however i have started quite a large project. Hence, for code cleanliness i would like to hold some of the functions, types etc. in other files apart from code.ts.
However, when i try to import a function into code.ts to run, from another file, Figma throws an error that it does not recognize the ‘import’ syntax.

Syntax error on line 1: Unexpected token

Is there a way to import a function to the code.ts, so that i dont have to copy the whole codebase into code.ts.

Set up your compiler to bundle the code into a single file.

1 Like

You are a life saver ! Thank you very much !