admin管理员组文章数量:1356024
I am currently Using Laravel 10 (I know it's outdated and I will upgrade asap), and I have node_modules
folder inside the project because i installed some npm modules that I need.
But I need to move the node_modules
to a separate Node.js-only project and somehow make the Laravel project use the node_modules
from there.
Right now the structure is:
laravel-project
|______node_modules
|________some-module
|________some-other-module
But I need it to be:
laravel-project
nodejs-project
|______node_modules
|________some-module
|________some-other-module
Is such thing possible?
I am currently Using Laravel 10 (I know it's outdated and I will upgrade asap), and I have node_modules
folder inside the project because i installed some npm modules that I need.
But I need to move the node_modules
to a separate Node.js-only project and somehow make the Laravel project use the node_modules
from there.
Right now the structure is:
laravel-project
|______node_modules
|________some-module
|________some-other-module
But I need it to be:
laravel-project
nodejs-project
|______node_modules
|________some-module
|________some-other-module
Is such thing possible?
Share Improve this question asked Mar 31 at 9:28 pileuppileup 3,3025 gold badges30 silver badges69 bronze badges1 Answer
Reset to default 1Yes, you can move your node modules to outside of the project and symlink it via
going into your laravel project and
ln -s /path/to/node_modules node_modules
This approach should minimize the need for adjustments in paths
Another way you can achieve it is by setting up your vite or mix to reference a folder outside of the project.
There are a few other ways, all dealing with configuration paths.
I do have to mention that I really don't recommend doing it as the idea of laravel is to wrap your project completely, and if you do this you will need to do it in any project you might want to launch or move anywhere.
If you do decide you want to take such an approach, don't fet to change those sources anywhere (especially if you're running the project with Docker).
本文标签: laravelImporting nodemodules from a dedicated Nodejs projectStack Overflow
版权声明:本文标题:laravel - Importing node_modules from a dedicated Node.js project - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743956978a2568308.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论