简体   繁体   English

缩小Html,Js,Css和Php

[英]Minify Html , Js , Css and Php

我正在寻找更好的方法来缩小这些文件,但我仍然是noob,目前我正在使用原子编辑器所以即时通讯使用一个名为atom-minify的插件,它缩小了我的css和js而不是html,之后我必须将proyecto压缩到上传到服务器或不是必要的?

Probably best is to use Gulp/ Grunt for such a thing. 可能最好是使用Gulp / Grunt来做这样的事情。 Here is how to set it up Grunt . 以下是如何设置Grunt

And then use plugin such as Grunt-minified to do your minifications(not sure if minifications is a real word but... :D). 然后使用Grunt-minified这样的插件进行缩小 (不确定缩小是否是真正的单词,但是......:D)。

In any case, its better if you use Grunt/ Gulp in your projects as they help you with: 在任何情况下,如果您在项目中使用Grunt / Gulp,它会更好,因为它们可以帮助您:

1) Work in as small chunks of CSS and JavaScript as makes sense to you, then concatenate them together for the production website. 1)使用CSS和JavaScript的小块对你有意义,然后将它们连接在一起用于生产网站。

2) Compress your CSS and minify your JavaScript to make their file sizes as small as possible for your production website. 2)压缩您的CSS并缩小您的JavaScript,使其文件大小尽可能小的生产网站。

3) Optimize your images to reduce their file size without affecting quality. 3)优化图像以减小文件大小而不影响质量。

4) Use Sass for CSS authoring because of all the useful abstraction it allows. 4)使用Sass进行CSS创作,因为它允许所有有用的抽象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM