how to link files in node_modules laravel

Viewed 4290

Hello guys I'm trying to link a package which I have installed using npm. But I cannot link the files to my html. I have also use the asset() but it did not work. Thank you!

<link href="node_modules/fullpage.js/dist/fullpage.css">

<script src="node_modules/fullpage.js/dist/fullpage.js"></script>
1 Answers

I don't think you can link directly to your node_modules folder

either add it in your app.scss and app.js as an import or extract it with laravel mix

In your mix

 mix.copy('node_modules/fullpage.js/dist/fullpage.js', 'public/js')

In html head

<script src="{{ mix("js/fullpage.js") }}"></script>
Related