开发者

Embedded web pages: best compression tool for css, javascript and html

开发者 https://www.devze.com 2023-04-12 08:12 出处:网络
I\'m searching for the best tool in order to compact css, javascript and html. Background: I\'m developing an administration UI in html5 on an embedded web server for a device with 8 MegaBytes of fla

I'm searching for the best tool in order to compact css, javascript and html.

Background: I'm developing an administration UI in html5 on an embedded web server for a device with 8 MegaBytes of flash memory. Functionalities are still rather advanced, but size is a concern.

The tool I'm looking for should ideally allow for inclusion开发者_如何学JAVA in our post-production shell scripts.

I'm already aware of YUI-compressor, but since I never used it extensively I was wondering if it represents the best solution or if there's something better to use.


Note: my answers are .NET based, because no OS/Framework was specified.

YUICompressor (and there's a .NET version on NuGet) is ok (Disclaimer: I'm a co-ordinator of the .NET project).

More recently, there's RequestReduce that is pretty damn awesome!

You also might want to check out SquishIt as a 3rd option.

Finally, the next version of .NET (at the time of this posting) will include this stuff finaly baked into the product.


There's maven-minify-plugin, it is configured such as:

  <plugin>
    <groupId>com.samaxes.maven</groupId>
    <artifactId>maven-minify-plugin</artifactId>
    <version>1.3.5</version>
    <executions>
      <execution>
        <id>default-minify</id>
        <phase>process-resources</phase>
        <configuration>
          <cssSourceIncludes>
            <cssSourceInclude>*.css</cssSourceInclude>
          </cssSourceIncludes>
          <jsSourceFiles>
              <jsSourceFile>app.js</jsSourceFile>
              <jsSourceFile>jquery.1.7.1.js</jsSourceFile>
          </jsSourceFiles>
        </configuration>
        <goals>
          <goal>minify</goal>
        </goals>
      </execution>
    </executions>
  </plugin>

There's yuicompressor library, which I've recently used with my app. This has however structural bugs, which makes it possible to use on application server only with strong combinations, as described in topic Yui compressor StringIndexOutOfBoundsException on jboss

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号