Question

How do you get Spine/Hem to render Jade templates? In the last line of the documentation it says you just have to include jade's runtime.js as a lib in slug.json but when I do that and run my application I get:

Uncaught ReferenceError: exports is not defined application.js:46
Uncaught ReferenceError: require is not defined

Is there more to it or am I just doing something wrong? I used npm to install jade so I just added the path in my slug.json like so:

{
  "dependencies": [
    "es5-shimify", 
    "json2ify", 
    "jqueryify", 
    "spine",
    "spine/lib/local",
    "spine/lib/ajax",
    "spine/lib/route",
    "spine/lib/manager"
  ],
  "libs": ["node_modules/jade/lib/runtime.js"]
}

Thanks

Était-ce utile?

La solution

Make sure you are on 0.3 version of hem or newer as jade support wasn't implemented before then then in addition to the up-todate hem docs at github.com/spine/hem checkout the slug.json for a simple example app I did that uses jade and hem

https://github.com/aeischeid/randomizable-excercise-picker/blob/b1c17e10ca1f3dd6e15d5127f1a9d029616f195d/slug.json

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top