I believe (dont know for sure) that laravel/resources is one of the paths that will also be checked if it cannot find the file relative to the current location. So it might be that this works in your case:
import BookRoutes from ../packages/shirshak/books/views/routes
If it doesn't, you can add this to your webpack.mix.js
mix.webpackConfig({
resolve: {
modules: [
path.resolve(__dirname),
path.resolve('./node_modules/'),
path.resolve('./resources/')
]
}
});
After that change, any relative package you import, will go in the order of:
- relative to current file
- relative to where webpack.mix.js is
- relative to node_modules
- relative to resources
So after that change you should be able to do:
import BookRoutes from packages/shirshak/books/views/routes