-
Notifications
You must be signed in to change notification settings - Fork 51
Closed
Description
Right now koa-ejs uses only actual node's filesystem.
This becomes trouble when using it with webpack-dev-middleware.
My case: I have server that uses dev middleware to manage compilation for client-side javascript. It keeps all generated assets in memory. I am able to access it's memory filesystem via devMiddlewareInstance.fileSystem which is memfs node's fs api compliant fs.
But koa-ejs accepts only path to root.
So, solution is either to add fs property to koa-ejs options which will accept any node's fs api compliant type. Or second way is to provide root as callback of type (templateFilename: string) => Promise<string>, like: root: (templateFilename) => myfs.readFilePromise(templateFilename).
What do you think?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels