I'm working on an application with NodeJS.
I'm trying to load one js file into the another using require().
My folder structure looks like:
src
- test1
- design
- reports
- components
- foo.js
- test2
- services
- bar.js
I am trying to call foo.js from bar.js using require() method.
When I do require('test1/design/reports/components/foo.js');
and run the app using grunt dev, I'm getting the following error:
Error: module "test1/design/reports/components/foo.js" not found from "(some path) test2.services.bar.js"
Can any one help to solve this?
Thanks.
require('../../test1/design/reports/components/foo.js');?