Cha*_*ell 13 compression minify visual-studio-2010 combres
我一直在我的应用程序中使用Combres在运行时压缩,组合和缩小我的javascript和css.这非常有效并且完美地满足YSlow.
现在我出于性能原因重新思考整个过程,我更考虑在构建时而不是运行时完成所有这些.
我希望我能在没有太多麻烦的情况下就如何做到这一点得到一些建议.是否存在可以满足我需要的现有工具(类似于Combres)?
Edu*_*eni 13
认识Chirpy
Chirpy Mashes,缩小并验证您的javascript,样式表和无点文件.
Chirpy很傻.使用Google Closure Tools或YUI Compressor for .Net来缩小和混合您所有的宝贵资产.它很简单,灵活,而且是自动的.
我最初使用Chirpy进行捆绑,但后来转移到Bundler。Bundler允许我相对轻松地将所有内容完美地连接到一个性感的构建文件(powershell)中。我个人已经不再使用 Visual Studio 构建事件,而是开始在独立环境中运行构建。这对我处理诸如Github到Team City持续集成 (CI)之类的事情很有帮助。
这是您的构建文件“可能”的样子。(注意可能无法完全运行,未经测试)
# Set up varriables for build script
$invocation = (Get-Variable MyInvocation).Value
$directorypath = Split-Path $invocation.MyCommand.Path
$BundlerDir = "$directorypath\build_tools\bundler\"
$AppRoot = "$directorypath\SomeApp.Web\"
$ScriptsDir = "scripts\"
$CssDir = "css\"
# Run Bundler to Combine and Minify
&($BundlerDir + "node.exe") ( $BundlerDir + "bundler.js") ($AppRoot +$CssDir) ($AppRoot + $ScriptsDir)
# Everything else...
# Clean the bins
# Build the projects
# Run the tests
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3896 次 |
最近记录: |