Automatically Injecting Unimport Imports Before File Execution with JITI EvalModule ? #61
Unanswered
productdevbook
asked this question in
Q&A
Replies: 1 comment
-
that solves my problem right now. But I don't know if it's the right approach. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
https://github.com/unjs/jiti/blob/main/src/eval.ts
jiti.evalModule
Is there a way to add imports before executing each file I enter? I need to inject or send the imports handled by Unimport into the files somehow. How can this be achieved?
evalModule traverses nested files, which is great, but it naturally throws an error when encountering an automatically imported function or constant. For example:
[2:13:53 PM] ERROR customBetterAuth is not defined
Beta Was this translation helpful? Give feedback.
All reactions