Closed arnoson closed 1 year ago
You guessed correctly, an internal Vite plugin will transform the following code in a first transformation step:
-kirbyup.import(<path>)
+kirbyup.import(import.meta.glob(<path>, { eager: true }))
Afterwards, Vite's glob import (transformation step 2) will handle resolving the JavaScript files.
The typings are technically correct, but not for the user, since won't see any of the transformations applied. We should improve the typings. Good catch.
Wow, thanks for the quick fix!
Right now the
import
function has this signature:But the example suggest that using a blob-string instead of a modules record is possible. Which will result in typescript errors, or am I missing something (I guess the blob-string gets transformed into a record by vite)?