我正在使用这里的示例项目。
假设我需要从我的模块中导出一些函数来为我的服务的客户端提供一些 JavaScript API。
但是我的 .js 文件中的声明在 RequireJS 之外是不可见的!
我将以下块添加到 jquery-require-sample/webapp/app.html:
<script type="text/javascript">
$(document).ready(function() {
$('body').alpha().beta();
});
</script>
它失败了:Uncaught TypeError: Object [object Object] has no method 'alpha'。
有可能做我想做的事吗?