When developing a Laravel project, sometimes you might need to copy the styling and scripts of an external library which is located inside the "node_modules". This is necessary in order to use the styling or scripts which by default can't be referenced when inside the node_modules.
Copy node_modules Style and Scripts using Laravel Mix
To copy the styles and scripts, you need to use Laravel Mix. A little bit of what Laravel Mix is:
For this example let's imagine you want to copy Highlight.js
styles from the "node_module" directory into your public directory. To do so you can write your code like below.
Once you have already define like so you can run the watch/dev/production command to copy the style/scripts.
npm run prod
If you are using yarn.