Closed mattisworking closed 3 years ago
Hey
Thanks, I really like this... could you also write tests?
Sorry to be a pain.
Hey I'm glad to hear that you like the added functionality!
I've added a test to verify that the context
folder is being created properly, and that the pagePath
will be overridden consistently. If you would like more tests then let me know, it's no trouble at all!
Code that is separated out into modules require the use of multiple
pagePaths
. I've added a way to define thepagePath
on a per-request basis by providing apage
key/value to thevueOptions
inrenderVue
.In addition to that, I've added a context field that can give a sort of namespace to the compiled folder allowing for multiple files to be rendered when they share the same name. (e.g. users/index and groups/index)
The new
pages
field is optional, as well as either thepath
orcontext
fields in it. If nothing is provided, the program will behave as it does currently making this a non-breaking change. Ifpath
is not provided it will default to the globalpagesPath
. Ifcontext
is not provided it will write everything to the root of.expressvue
Also I've added some minor error-checking for when the
memoryParsed
variable is trying to be determined.Here would be an example of using
renderVue
with the changes: