Importing from local files (i.e. utils.ts)?
Hey @omar2205
This is what I have done with JS
import { myImport } from "./common/functions.js"
export default async (request, context) => {
/**
* Stuff here...
*/
};
I donβt use TS, but I believe it is much the same.
I did a similar thing, but I keep seeing the utils
function in the build logs.
Can you share the logs?
Packaging Edge Functions from netlify/edge-functions directory:
... actual functions
- utils
I was thinking that maybe there is a way to include files without being treated as functions.
If it is in the edge-functions
directory, it is treated as a function. Move utils.ts
into another directory e.g.
edge-function
βββ common
β βββ auth.js
β βββ utils.ts
βββ a-function.ts
βββ hello-world.js
and include utils.ts
as per previously mentioned.
1 Like