2

我正在使用带有asset_pipeline 的Rails 4 应用程序使用Bootstrap。asset_pipeline 自动将所有 js 和 css 文件连接成一个。

但是,这些文件非常大(~120K)并且需要很长时间才能加载。有没有办法从基本文件中自动删除我的应用程序中未使用的 css 元素和 js 方法?

4

1 回答 1

1

From the accepted answer on How do I identify and eliminate unused CSS styles from my bloated stylesheet? you could try:

https://addons.mozilla.org/en-US/firefox/addon/10704/

Credit to Steve Fenton

Remember also that you should be gzipping the css & JS files at the server level, so the actual file size will be substantially less than 120 K

Good luck!

于 2013-10-08T12:35:18.263 回答