RequireJS优化参考错误
我正在使用 RequireJS 来组织我的 JS 文件。我正在尝试将我的文件优化为一个主 JS 文件。
我正在使用以下命令来执行此操作:
/home/plugins/requireJS/build/build.sh name=main out=mesh-built.js baseUrl=/home/public_html/js/ includeRequire=true
该命令产生以下错误:
Tracing dependencies for: main
node.js:116
throw e; // process.nextTick error, or 'error' event on first tick
^
ReferenceError: $ is not defined
at eval at <anonymous> (/home/plugins/requireJS/bin/../build/jslib/requirePatch.js:147:21)
at Function.<anonymous> (eval at <anonymous> (/home/plugins/requireJS/bin/../build/jslib/requirePatch.js:147:21))
at Function.load (/home/plugins/requireJS/bin/../build/jslib/requirePatch.js:147:21)
at loadPaused (require.js:916:21)
at require.js:958:21
at Object.completeLoad (require.js:1207:17)
at Function.load (/home/plugins/requireJS/bin/../build/jslib/requirePatch.js:150:29)
at loadPaused (require.js:916:21)
at require.js:958:21
at Object.completeLoad (require.js:1207:17)
有谁知道为什么会产生此错误?
非常感谢。
I am using RequireJS to organise my JS files. I am attempting optimize my files into one main JS file.
I am using the following command to do this:
/home/plugins/requireJS/build/build.sh name=main out=mesh-built.js baseUrl=/home/public_html/js/ includeRequire=true
The command produces the following error:
Tracing dependencies for: main
node.js:116
throw e; // process.nextTick error, or 'error' event on first tick
^
ReferenceError: $ is not defined
at eval at <anonymous> (/home/plugins/requireJS/bin/../build/jslib/requirePatch.js:147:21)
at Function.<anonymous> (eval at <anonymous> (/home/plugins/requireJS/bin/../build/jslib/requirePatch.js:147:21))
at Function.load (/home/plugins/requireJS/bin/../build/jslib/requirePatch.js:147:21)
at loadPaused (require.js:916:21)
at require.js:958:21
at Object.completeLoad (require.js:1207:17)
at Function.load (/home/plugins/requireJS/bin/../build/jslib/requirePatch.js:150:29)
at loadPaused (require.js:916:21)
at require.js:958:21
at Object.completeLoad (require.js:1207:17)
Does anyone know why it would be producing this error?
Many thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这是要包含的文件顺序的问题。确保首先包含定义 $() 的 JS 文件。
I think its a problem with the order of the files to include. Make sure the JS file which defines the $() is included first.