我想在我的 Spine 应用程序中使用javascript API Stylus 提供。
为此,我必须使用 Stylus。
因为 Stylus 是 Hem 的依赖项,所以我尝试在 index.coffee 中要求它:
Stylus ?= require('stylus')
但这导致了一个错误:
uncaught exception: module Stylus not found
然后我尝试在 package.json 中独立包含 Stylus
{
"name": "Blank",
"version": "0.0.1",
"engines": {
"node": "0.6.x",
"npm": "1.0.x"
},
"dependencies": {
"serveup": "~0.0.2",
"hem": "~0.1.7",
"stylus" : "~0.22.6",
"es5-shimify": "~0.0.1",
"json2ify": "~0.0.1",
"jqueryify": "~0.0.1",
"spine": "~1.0.5",
"spine.mobile": "~1.0.0",
"gfx": "~0.0.4"
}
}
在我的 slug.json
{
"dependencies": [
"es5-shimify",
"json2ify",
"jqueryify",
"spine",
"spine/lib/local",
"spine/lib/ajax",
"spine/lib/relation",
"spine/lib/route",
"spine/lib/tmpl",
"spine/lib/manager",
"stylus"
],
"libs": []
}
但这导致服务器日志中出现错误:
Unhandled error!
我如何需要 Stylus 并在 Spine 中使用它的 API?