我们已经有一个 AMD 的 require.js 实现,它已经使用了很长时间,现在团队决定使用 r.js 优化器来优化构建。我正在按照步骤操作,但我认为我遗漏了一些东西:
我们有 require.config ,如下所示:
require.config({
waitSeconds : 15,
baseUrl: window.rootPath + 'scripts',
paths: {
jquery: 'empty:',
jqueryui: 'empty:',
recaptcha: '//www.google.com/recaptcha/api/js/recaptcha_ajax',
maxmind: '//j.maxmind.com/app/geoip',
enduser: '/enduser/scripts/system',
cookies: '/enduser/scripts/system/cookies',
errorhandler: '/enduser/scripts/system/errorhandler',
underscore: '/enduser/scripts/underscore',
blockui: '/enduser/scripts/jquery.blockui',
messaging: '/enduser/scripts/system/messaging',
jgrowl: '/enduser/scripts/jquery.jgrowl',
knockout: 'knockout-latest.debug',
kobindings: '/enduser/scripts/system/bindings',
async: 'plugins/require/async',
depend: 'plugins/require/depend',
font: 'plugins/require/font',
goog: 'plugins/require/goog',
image: 'plugins/require/image',
json: 'plugins/require/json',
noext: 'plugins/require/noext',
mdown: 'plugins/require/mdown',
propertyParser: 'plugins/require/propertyParser',
markdownConverter: 'lib/Markdown.Converter'
},
priority: ['jquery']
});
require(["main"]);
请注意,它具有 CDN 路径而不是“空”。但是在网上阅读了一些帖子后,我将那里替换为空。我正在运行以下命令:
node -o name="filepath" output="output file path"
它说跟踪依赖关系,然后抛出一个错误,说它没有找到 jquery.js。有什么建议么?