我已从laravel 5.3升级到5.4并切换到使用webpack而不是gulp。运行时一切正常
npm run dev
但是一旦我将其用于生产
npm rum production
我收到以下警告。
95% emitting
DONE Compiled successfully in 25146ms
WARN: Output exceeds 32000 characters
WARN: Output exceeds 32000 characters
WARN: Output exceeds 32000 characters
WARN: Output exceeds 32000 characters
WARN: Output exceeds 32000 characters
我添加了这段代码,(甚至不确定这是否有效)我没有在构建中遇到任何错误,但是我的webpack.mix.js文件。
mix.options({
uglify: {
output: 50000
}
});
这些警告我在我当地的宅基地开发环境和生产服务器上。
正常的laravel dependancies(jquery,bootstrap)构建到app.js
所有我的第三方供应商脚本n构建到vendors.js
我构建到custom.js的所有自定义代码
只是为了看看这是否解决了这个问题,但事实并非如此。
更新
当我删除此供应商部分警告消失时,是否有更好的方法来包含这些脚本?
// Vendors
mix.scripts([
paths.vendors + 'jquery/jquery-ui.min.js',
// paths.node + 'pjax/pjax.js',
paths.vendors + 'pjax/jquery.pjax.min.js',
paths.node + 'bootstrap-sass/assets/javascripts/bootstrap/transition.js',
paths.node + 'bootstrap-sass/assets/javascripts/bootstrap/collapse.js',
paths.vendors + 'datatable/jquery.dataTables.min.js',
paths.vendors + 'datatable/dataTables.bootstrap.js',
paths.vendors + 'datatable/dataTables.buttons.min.js',
paths.vendors + 'form-validation/dist/js/formValidation.js',
paths.vendors + 'form-validation/dist/js/framework/bootstrap.js',
paths.vendors + 'detect/detect.js',
paths.vendors + 'fastclick/fastclick.js',
paths.vendors + 'jquery/jquery.slimscroll.js',
paths.vendors + 'jquery/jquery.blockUI.js',
paths.vendors + 'jquery/jquery.nicescroll.js',
paths.vendors + 'jquery/jquery.scrollTo.min.js',
paths.vendors + 'modernizr/modernizr.min.js',
paths.vendors + 'pace/pace.min.js',
paths.node + 'moment/moment.js',
paths.vendors + 'bootstrap-datepicker/src/js/bootstrap-datetimepicker.js',
paths.vendors + 'notifyjs/dist/notify.min.js',
paths.vendors + 'notifications/notify-metro.js',
paths.node + 'sweetalert/dist/sweetalert.min.js',
paths.vendors + 'waitMe/waitMe.min.js',
paths.node + 'Select2/select2.js',
paths.node + 'summernote/dist/summernote.min.js',
paths.vendors + 'datatable/buttons.bootstrap.min.js',
paths.vendors + 'datatable/jszip.min.js',
paths.vendors + 'datatable/pdfmake.min.js',
paths.vendors + 'datatable/vfs_fonts.js',
paths.vendors + 'datatable/buttons.html5.min.js',
paths.vendors + 'datatable/buttons.print.min.js',
paths.vendors + 'datatable/dataTables.fixedHeader.min.js',
paths.vendors + 'datatable/dataTables.keyTable.min.js',
paths.vendors + 'datatable/dataTables.responsive.min.js',
paths.vendors + 'datatable/responsive.bootstrap.min.js',
paths.vendors + 'datatable/dataTables.scroller.min.js'
], 'public/js/vendors.js' );
这些导致尺寸问题
paths.vendors + 'datatable/buttons.bootstrap.min.js',
paths.vendors + 'datatable/jszip.min.js',
paths.vendors + 'datatable/pdfmake.min.js',
paths.vendors + 'datatable/vfs_fonts.js',
paths.vendors + 'datatable/buttons.html5.min.js',
paths.vendors + 'datatable/buttons.print.min.js',
paths.vendors + 'datatable/dataTables.fixedHeader.min.js',
paths.vendors + 'datatable/dataTables.keyTable.min.js',
paths.vendors + 'datatable/dataTables.responsive.min.js',
paths.vendors + 'datatable/responsive.bootstrap.min.js',
paths.vendors + 'datatable/dataTables.scroller.min.js'