简体   繁体   English

如何链接 node_modules laravel 中的文件

[英]how to link files in node_modules laravel

Hello guys I'm trying to link a package which I have installed using npm.大家好,我正在尝试链接我使用 npm 安装的软件包。 But I cannot link the files to my html.但我无法将文件链接到我的 html。 I have also use the asset() but it did not work.我也使用了 asset() 但它没有用。 Thank you!谢谢!

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

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

I don't think you can link directly to your node_modules folder我认为您不能直接链接到您的 node_modules 文件夹

either add it in your app.scss and app.js as an import or extract it with laravel mix将它添加到您的 app.scss 和 app.js 作为导入或使用 laravel mix 提取它

In your mix在你的组合中

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

In html head在 html 头中

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM