Closed blaasvaer closed 5 years ago
Hello @blaasvaer -Could you please share your project's folder structure? By looking at your comment; your structure should be like this (to work):
/app
index.js
/modules
router.js
also, the call should be:
require('attract')({ basePath: '../modules'});
const Router = attract('router');
finally, to ensure your script is being called from the right places, you might want to resolve
the right path;
require('attract')({ basePath: require('path').resolve(__dirname, '../modules')});
const Router = attract('router');
Let me know how it goes! 👍
I need to add '../modules' as a resolve path, but it's not working.
I call 'router' from 'app/index' and need to automatically resolve (shared) modules on a higher level.
Neither 'app-module-path' nor this works. Why is that, what am I totally missing about these types of modules?