【发布时间】:2015-03-11 11:29:51
【问题描述】:
这是我的配置
requirejs.config({
baseUrl : 'vassets/lib/',
shim : {
'knockout' : [ 'jquery' ]
},
paths : {
jquery : 'jquery/jquery.min',
knockout : 'knockout/knockout',
selectize : 'selectize.js/js/standalone/selectize.min',
main : '/vassets/js/koapp/main',
jsep : '/vassets/js/jsep/jsep.min'
}
});
jsep 是 javascript 表达式解析器,可在此处获得 http://jsep.from.so/
这是我的模块定义:
define ()->
require ['jsep'],(jsep)->
console.log jsep
# does not work, jsep is undefined
()->
console.log jsep
# does not work, jsep is available. but HOW????
# I dont see this type of usage in api documnentation. How does this work?
另外下面的模块定义也不行
define ['jsep'], (jsep)->
console.log jsep
# does not work
# this is the normal usage I find in documentation, why this does not work???
可以
【问题讨论】:
-
@Qantas94 非常感谢。它当然是重复的。但我不知道要寻找什么。我有一个最低限度的工作示例,为什么要拒绝投票。
标签: javascript coffeescript requirejs