laravel app.js很大文件大小 [英] laravel app.js very large file size

查看:175
本文介绍了laravel app.js很大文件大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将Laravel 5.3应用程序部署到了Heroku.但是,在加载/login时,我注意到页面加载时间非常慢.问题似乎是很大的app.js文件:/js/app.js.这是DevTools中网络"资源面板的屏幕截图:屏幕截图-网络"面板.顶部的第三个资源是有问题的文件.

I have deployed a Laravel 5.3 application to Heroku. However, when loading /login, I noticed a very slow page load time. The problem seems to be a very large app.js file: /js/app.js. Here is a screenshot of the Network resource panel in DevTools: screenshot- Network panel. The 3rd resource from the top is the offending file.

我不确定为什么这个文件太大了.这是存储库的链接: https://github.com/AshMenhennett/Salon-Pricing

I am not sure why this file has gotten so large. here is a link to the repository: https://github.com/AshMenhennett/Salon-Pricing.

我无法再发布链接,所以请告诉我您是否要直接链接到特定文件.

I wasn't able to post anymore links, so do let me know if you would like direct links to specific files.

我应该怎么做才能缓解这个问题?

What should I be doing to mitigate this issue?

推荐答案

从链接的外观来看,您尚未创建资产的生产版本,并且当前所有源映射都在您的app.js文件中,该文件将会增加很多文件大小,css和js输出也不会压缩/缩小.

From the looks of your link you've not created a production version of your assets, and currently all the source maps are in your app.js file, which will be adding a lot of the file size, the css and js output are also not compress/minified either.

假设您使用的是laravel elixir,则只需运行gulp --production,这将删除源映射,压缩js和css输出等.

Assuming you're using laravel elixir, you just need to run gulp --production and this will remove the source maps, compress the js and css outputs, etc.

这篇关于laravel app.js很大文件大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆