[英]How to include JQuery from node_modules, except from cdn in Laravel 5.8 app?
[英]How to add plugins from node_modules to Laravel mix
這是我的代碼
mix.js([
'node_modules/chocolat/dist/js/jquery.chocolat.js',
'node_modules/textcounter/jquery.textcounter.js',
'node_modules/foundation-sites/dist/js/foundation.js',
'node_modules/owl.carousel/dist/owl.carousel.js',
'resources/assets/js/jquery.fileuploader.min.js',
'resources/assets/js/app.js',
], 'public/js/all.js', './');
我收到未定義 jQuery 的錯誤。 我已經下載了它,它是 100% 那里。
在 github 存儲庫中提供的示例中,您可以看到它通常是如何包含的。 檢查這個文件: resources\\assets\\js\\bootstrap.js
你應該更新你的 webpack 文件。 您沒有在數組中包含 vanilla jquery。 您應該將其作為數組中的第一項。 此外,如果您只想連接腳本,您應該使用scripts()
方法而不是js()
方法。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.