2

All of the markojs.com documentation says to render your marko templates like so:

require('marko/node-require')
require('./template.marko').render()

However, I couldn't find any ability to render marko templates that don't make use of a require hook.

I was hoping for something like this:

require('marko').compile('./template.marko').render()
// or the shorthand
require('marko').render('./template.marko')

What are my options here?

balupton
  • 47,113
  • 32
  • 131
  • 182

1 Answers1

2

Just going to copy over my response from the Marko Gitter for greater visibility.

Your best options here are either:

  1. Use require('marko').load(filename)
  2. Pre compile your server side templates using webpack, rollup or parcel.
Piercey4
  • 1,318
  • 11
  • 10