2
我有一个使用通过require.js +文本插件underscore.js模板和加载它们的应用程序:从requirejs优化剔除模板
define([..., 'text!templates/app/authentication.html'], function(..., Template) {
...
});
所有工作正常,但现在我要来连接我所有的js文件到Grunt.js和require.js优化器。以下是繁重的文件的相应部分:
requirejs: {
compile: {
options: {
name : 'main',
baseUrl: "www/js",
optimize: "none",
out: "www/js/result.js",
stubModules : ['text'],
paths : {
text: 'vendor/text',
...
},
shim: {
...
}
}
}
}
但咕噜抛出我的下一个错误:
Running "requirejs:compile" (requirejs) task
>> Tracing dependencies for: nexusapp
>> Error: ENOENT, no such file or directory
>> 'D:\templates\app\authentication.html'
>> In module tree:
>> main
>> app
>> app.authentication
>> text
Warning: RequireJS failed. Use --force to continue.
Aborted due to warnings.
优化试图读取文件忽略指定baseUrl
。 我该如何解决这个问题?
预先感谢您!