I am having trouble to reference requirejs modules with relative path in the code and have them working with grunt-contrib-requirejs. Anyone has any clue on why this might happen?
File Structure:
src
|
--config.js
|
--js/
|
--package
|
---project.js
|
---utils.js
Requirejs config:
require.config({
paths: {
jquery: 'vendor/jquery-1.10.1.min'
},
shim: {
jquery: []
}
});
GruntFile:
requirejs: {
compile: {
options: {
name : "./js/package/project",
baseUrl: "src",
mainConfigFile: "src/config.js",
out: "build/js/project-build.js"
}
}
}
In the project.js file, I am referencing a util.js as tryout,
var utilsObject = require('./js/package/utils.js');
When I run grunt requirejs, I get following error:
Error: ENOENT, no such file or directory
>> '{folder}/src/js/package/js/package/utils.js'
>> In module tree:
>> js/package/project