Node / NPM to manage JS / CSS in Laravel
To manage your js and css files in Laravel you could place your js and css files in the public directory, but using the /resources/assets folder you can add your js and css (sass or less, etc) in there.
You then need to compile these with nodejs and NPM. To install nodejs / npm on Ubuntu you can use
sudo apt-get install nodejs
Once installed in a terminal window navigate to your Laravel project directory and type:
node install
Once that’s done you can view the file package.json.
These are the js and css files that node manage for this project. Each of the script names can be run using npm.
Eg, in my test Laravel site part of this file says:
John, a seasoned Freelance Full Stack Developer based in South Africa, specialises in delivering bespoke solutions tailored to your needs. With expertise in back end languages and frameworks, PHP, Laravel and Golang and Front end frame words Vue3, Nuxt3 as well as Angular, I am equipped to tackle any project, ensuring robust, scalable, and cutting-edge outcomes.
My comprehensive skill set enables me to provide exceptional freelance services both remotely and in person. Whether you’re seeking to develop an innovative application or require meticulous refinement of existing systems, I am dedicated to elevating your digital presence through unparalleled technical prowess and strategic development methodologies. Let’s connect to transform your vision into reality.