如何将JavaScript和CSS文件一起缩小?
目前我有:
let mix = require('laravel-mix');
mix.styles([
'theme/admin/assets/css/bootstrap.css',
'theme/admin/assets/font-awesome/css/font-awesome.css',
'theme/admin/assets/css/zabuto_calendar.css',
'theme/admin/assets/lineicons/style.css',
'theme/admin/assets/css/style.css',
'theme/admin/assets/css/style-responsive.css',
'css/adminstyle.css'
], 'public/css/admin.css');
mix.scripts([
'theme/admin/assets/js/jquery.min.js',
'theme/admin/assets/js/bootstrap.min.js',
'theme/admin/assets/js/jquery.dcjqaccordion.2.7.js',
'theme/admin/assets/js/jquery.scrollTo.min.js',
'theme/admin/assets/js/jquery.nicescroll.js',
'theme/admin/assets/js/jquery.sparkline.js',
'theme/admin/assets/js/common-scripts.js',
'theme/admin/assets/js/zabuto_calendar.js'
], 'public/js/admin.js');
在我的webpack.mix.js
文件中,但它会创建空文件。
答案 0 :(得分:1)
您必须从Laravel应用程序的根目录使用完整路径启动。
所以而不是:
'theme/admin/assets/css/bootstrap.css'
正如您所说,theme
位于public
之下,您应该这样做:
'public/theme/admin/assets/css/bootstrap.css'
对网址的其余部分进行此更新