问题
I figured that the latest build release would allow me to use ejs globally without using node so I tried doing so.
Though, when I try to use ejs.renderFile(params...), i get the error:
TypeError: exports.fileLoader is not a function
Which is just another node module. Is there a way to get around this?
Note: This is the only time we use EJS at my company, so, if not, would you kindly point me in a good direction in how to render .ejs files.
回答1:
Update: You can create an EJS object by running
new EJS({url: some/url/to/file.ejs}).render({dataToPass: data, moreData: secondData});
来源:https://stackoverflow.com/questions/61100840/using-ejs-without-nodejs