通过使用Laravel,不可能编译已经缩小的JS的列表,这就像是Webpack忽略了它:
.js(
[
'resources/assets/theme/js/bootstrap.min.js',
'resources/assets/theme/js/canvasjs.min.js',
'resources/assets/theme/js/contact.js',
'resources/assets/theme/js/countdown.js',
'resources/assets/theme/js/counterup.min.js',
'resources/assets/theme/js/jquery-3.3.1.min.js',
'resources/assets/theme/js/jquery-ui.min.js',
'resources/assets/theme/js/magnific-popup.min.js',
'resources/assets/theme/js/main.js',
'resources/assets/theme/js/map.js',
'resources/assets/theme/js/modernizr-3.6.0.min.js',
'resources/assets/theme/js/nice-select.js',
'resources/assets/theme/js/owl.min.js',
'resources/assets/theme/js/paroller.js',
'resources/assets/theme/js/plugins.js',
'resources/assets/theme/js/waypoints.js',
'resources/assets/theme/js/wow.min.js'
]
, 'public/theme/js/min.js')
有什么想法吗?
谢谢你的帮忙
发布于 2020-10-11 23:11:11
您使用的是Laravel Mix。即使.js文件被缩小,它也不会被忽略。实际发生的情况是,您包含了一个'bootstrap.min.js‘,但该库也需要jQuery。尝试像这样添加jQuery:
.js(
[
'resources/assets/theme/js/jquery.min.js', // this one
'resources/assets/theme/js/bootstrap.min.js',
'resources/assets/theme/js/canvasjs.min.js',
'resources/assets/theme/js/contact.js',
'resources/assets/theme/js/countdown.js',
'resources/assets/theme/js/counterup.min.js',
'resources/assets/theme/js/jquery-3.3.1.min.js',
'resources/assets/theme/js/jquery-ui.min.js',
'resources/assets/theme/js/magnific-popup.min.js',
'resources/assets/theme/js/main.js',
'resources/assets/theme/js/map.js',
'resources/assets/theme/js/modernizr-3.6.0.min.js',
'resources/assets/theme/js/nice-select.js',
'resources/assets/theme/js/owl.min.js',
'resources/assets/theme/js/paroller.js',
'resources/assets/theme/js/plugins.js',
'resources/assets/theme/js/waypoints.js',
'resources/assets/theme/js/wow.min.js'
]
, 'public/theme/js/min.js')
https://stackoverflow.com/questions/64305521
复制相似问题