I have a problem with optimization with r.js
I have a project that have multiple requirejs config file
+ app
- module1
* main.js
* foo.js
* bar.js
- main.js
+ build.js
that each main.js has self packages
main.js code is:
requirejs.config({
'baseUrl': '../app/',
'paths': {
'module1' : 'module1/main'
}
});
define(['module1'],function(){});
module1/main.js code like:
requirejs.config({
'paths': {
'foo' : 'module1/foo',
'bar' : 'module1/bar'
}
});
define(['foo','bar'],function(){});
and build.js file is like:
({
mainConfigFile: 'app/main.js',
baseUrl: 'app',
name: 'main',
out: 'dist/main.js',
})
when I execute $ r.js -o build.js
it return an error
Tracing dependencies for: main
Error: ENOENT: no such file or directory, open 'D:\Project\Test\app\foo.js'
In module tree:
main
module1
Error: Error: ENOENT: no such file or directory, open 'D:\Project\Test\app\foo.js'
In module tree:
main
module1
at Error (native)