You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
@Reeywhaar, I think the best apport to keep the code cleaner is by providing an fs option as you mention. If it's okay, for your use case I will ship it in the next release (check it here)
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'sfs
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'sfs
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?
The text was updated successfully, but these errors were encountered: