简体   繁体   English

如何使用 Laravel mix 链接到 node_modules 文件夹

[英]How to link to node_modules folder with Laravel mix

I'm using the Metronic theme and installed the packages with npm and now a bunch of what I need is in the node_modules folder.我正在使用 Metronic 主题并使用 npm 安装了软件包,现在我需要的一堆东西在 node_modules 文件夹中。

How do I link to these in laravel mix?我如何在 laravel mix 中链接到这些?

Ive tried googling and reading the laravel mix documentation however kind of stuck on this.我试过谷歌搜索和阅读 laravel mix 文档,但是有点坚持这个。

The documentation seems to explain how to import (.js and .css) and copy assets (images etc..)该文档似乎解释了如何导入(.js 和 .css)和复制资产(图像等)

Working With JavaScript : You could amend the example to something like mix.js('node_modules/metronic/src/js/framework/components/general/menu.js', 'public/js');使用 JavaScript :您可以将示例修改为mix.js('node_modules/metronic/src/js/framework/components/general/menu.js', 'public/js');

Working With Stylesheets : Amend this example to something like mix.sass('node_modules/metronic/src/sass/framework/_config.scss', 'public/css');使用样式表:将此示例修改为mix.sass('node_modules/metronic/src/sass/framework/_config.scss', 'public/css');

Copying Files & Directories : Directly from the example mix.copy('node_modules/foo/bar.css', 'public/css/bar.css'); 复制文件和目录:直接从示例mix.copy('node_modules/foo/bar.css', 'public/css/bar.css');

please note the node_modules/metronic/ path is my best guess请注意node_modules/metronic/路径是我最好的猜测

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

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