执行优化语句时:
r.js -o app.build.js
Optimize命令会抛出错误:
Error: ENOENT, no such file or directory '[...]/js/customizer-build/marionette.js'
app.build.js
({
appDir: "./",
baseUrl: "./",
dir: "../customizer-build",
modules: [
{
name: "main"
}
]
})
Marionette被指定为 main.js 的require.config中的模块:
require.config({
shim: {
//....
marionette: {
deps: [
'backbone'
],
exports: 'Marionette'
},
//....
paths: {
//....
marionette: '/js/lib/marionette/lib/backbone.marionette.min',
//....
}
});