📜 ⬆️ ⬇️

Bundle Transformer 1.6.2 released or what has changed in six months?

Bundle Transformer logo
Bundle Transformer is a modular extension developed by me for the Microsoft ASP.NET Web Optimization Framework (other names: ASP.NET Bundling and Minification, System.Web.Optimization, Microsoft.Web.Optimization and ASP.NET Optimization - Bundling). In April of this year I already did a detailed review of the capabilities of the Bundle Transformer , but during this time this product has changed a lot. Therefore, I decided to write this review and tell about the main changes that have occurred in the Bundle Transformer over the past six months.

Changes related to the development of the Microsoft ASP.NET Web Optimization Framework


The April version of Bundle Transformer was developed for the 1st beta of the Microsoft ASP.NET Web Optimization Framework (hereinafter referred to as B / M). Already in the second beta of B / M, major changes occurred: the API changed dramatically, support for debug mode appeared, and the ability to create dynamic bundles was outdated (the EnableDefaultBundles method and the DynamicFolderBundle class are no longer recommended). There were no major changes in the final version of B / M, but one very useful feature was added - this is CDN support.

All of the above changes also affected the Bundle Transformer.

Starting from the 2nd B / M beta, it is recommended to transfer the code that creates the bundles from the Global.asax file to the BundleConfig class and place this class in the App_Start directory. In the Global.asax file, you only need to leave the RegisterBundles method of the BundleConfig class:
')
 using System.Web.Mvc; using System.Web.Optimization; using System.Web.Routing; namespace BundleTransformer.Example.Mvc { public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); //   bundle` BundleConfig.RegisterBundles(BundleTable.Bundles); } } } 

Consider creating bundles and setting up their processing using Bundle Transformer using the example of the following BundleConfig class:

 using System.Web.Optimization; using BundleTransformer.Core.Orderers; using BundleTransformer.Core.Transformers; namespace BundleTransformer.Example.Mvc { public class BundleConfig { public static void RegisterBundles(BundleCollection bundles) { var cssTransformer = new CssTransformer(); var jsTransformer = new JsTransformer(); var nullOrderer = new NullOrderer(); var commonStylesBundle = new Bundle("~/Bundles/CommonStyles"); commonStylesBundle.Include( "~/Content/Site.css", "~/Content/BundleTransformer.css", "~/AlternativeContent/css/TestCssComponentsPaths.css", "~/Content/themes/base/jquery.ui.core.css", "~/Content/themes/base/jquery.ui.theme.css", "~/Content/themes/base/jquery.ui.resizable.css", "~/Content/themes/base/jquery.ui.button.css", "~/Content/themes/base/jquery.ui.dialog.css", "~/Content/TestTranslators.css", "~/Content/TestLess.less", "~/Content/TestSass.sass", "~/Content/TestScss.scss"); commonStylesBundle.Transforms.Add(cssTransformer); commonStylesBundle.Orderer = nullOrderer; bundles.Add(commonStylesBundle); var modernizrBundle = new Bundle("~/Bundles/Modernizr"); modernizrBundle.Include("~/Scripts/modernizr-2.*"); modernizrBundle.Transforms.Add(jsTransformer); modernizrBundle.Orderer = nullOrderer; bundles.Add(modernizrBundle); var commonScriptsBundle = new Bundle("~/Bundles/CommonScripts"); commonScriptsBundle.Include("~/Scripts/MicrosoftAjax.js", "~/Scripts/jquery-{version}.js", "~/Scripts/jquery-ui-{version}.js", "~/Scripts/jquery.validate.js", "~/Scripts/jquery.validate.unobtrusive.js", "~/Scripts/jquery.unobtrusive-ajax.js", "~/Scripts/knockout-2.*", "~/Scripts/TestCoffeeScript.coffee"); commonScriptsBundle.Transforms.Add(jsTransformer); commonScriptsBundle.Orderer = nullOrderer; bundles.Add(commonScriptsBundle); var jqueryUiStylesDirectoryBundle = new Bundle("~/Bundles/JqueryUiStylesDirectory"); jqueryUiStylesDirectoryBundle.IncludeDirectory("~/Content/themes/base/", "*.css"); jqueryUiStylesDirectoryBundle.Transforms.Add(new CssTransformer( new[] { "*.all.css", "jquery.ui.base.css" })); bundles.Add(jqueryUiStylesDirectoryBundle); var scriptsDirectoryBundle = new Bundle("~/Bundles/ScriptsDirectory"); scriptsDirectoryBundle.IncludeDirectory("~/Scripts/", "*.js"); scriptsDirectoryBundle.Transforms.Add(new JsTransformer( new[] { "*.all.js", "references.js" })); bundles.Add(scriptsDirectoryBundle); } } } 

The main difference compared to the 1st B / M beta is that the Include and IncludeDirectory methods are now used to add files and directories (instead of the AddFile and AddDirectory ). In addition, adding transformations is now not done through the Bundle class constructor, but through its Transforms property (in the code above, you can see this in the example of adding instances of the CssTransformer and JsTransformer ).
It is worth noting that, in addition to the Bundle class, for creating bundles, its subclasses StyleBundle (for styles) and ScriptBundle (for scripts) can also be used. Transformations are already added to these classes that are responsible for minimizing the code (instances of the CssMinify and JsMinify ). In our case, we cannot use these subclasses, because we need to add transformations from the Bundle Transformer (instances of the CssTransformer and JsTransformer ) instead of instances of the CssMinify and JsMinify classes.

Consider registering links to created bundles in the view code using the _Layout.cshtml file as an _Layout.cshtml :

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>@ViewBag.Title - Bundle Transformer Example MVC Application</title> <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" /> <meta name="viewport" content="width=device-width" /> @Styles.Render("~/Bundles/CommonStyles") @Scripts.Render("~/Bundles/Modernizr") ... </head> <body> ... @Scripts.Render("~/Bundles/CommonScripts") @RenderSection("scripts", required: false) </body> </html> 

Now links to bundles are added to the view code using the Render method ( Styles.Render used for CSS, and Scripts.Render for JavaScript). Using the Render method not only makes adding links to bundles more convenient, but also solves the main problem with earlier versions of B / M - debug mode support.

B / M determines the mode in which the web application is located, based on the following settings:
  1. The values ​​of the debug attribute of the compilation element from the Web.config file ( true - debug mode; false - release mode);
  2. The values ​​of the BundleTable.EnableOptimizations property, which can be specified in the BundleConfig class ( true - release mode; false - debug mode). Moreover, the value of the BundleTable.EnableOptimizations property takes precedence over the settings from the Web.config file.

In release mode, the code of the bundle files is combined and processed (transformations are applied). The output is the following HTML code:

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Home Page - Bundle Transformer Example MVC Application</title> <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" /> <meta name="viewport" content="width=device-width" /> <link href="/Bundles/CommonStyles?v=IWN75r8IOIWnlehQ6JVPUgrb7UER075iobpzbjYTtRQ1" rel="stylesheet"/> <script src="/Bundles/Modernizr?v=1dm47T0PPFmcdy8ssp2EZ4h8yT2SjNhVvtdbc0MyDAs1"></script> ... </head> <body> ... <script src="/Bundles/CommonScripts?v=qWsyReB8UFAt-HPS-6MCkeDDTs2lQgYMdyCUd2V9O4o1"></script> </body> </html> 

And in debug mode, the files included in the bundle are displayed in their original form and separately:

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Home Page - Bundle Transformer Example MVC Application</title> <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" /> <meta name="viewport" content="width=device-width" /> <link href="/Content/Site.css" rel="stylesheet"/> <link href="/Content/BundleTransformer.css" rel="stylesheet"/> <link href="/AlternativeContent/css/TestCssComponentsPaths.css" rel="stylesheet"/> <link href="/Content/themes/base/jquery.ui.core.css" rel="stylesheet"/> <link href="/Content/themes/base/jquery.ui.theme.css" rel="stylesheet"/> <link href="/Content/themes/base/jquery.ui.resizable.css" rel="stylesheet"/> <link href="/Content/themes/base/jquery.ui.button.css" rel="stylesheet"/> <link href="/Content/themes/base/jquery.ui.dialog.css" rel="stylesheet"/> <link href="/Content/TestTranslators.css" rel="stylesheet"/> <link href="/Content/TestLess.less" rel="stylesheet"/> <link href="/Content/TestSass.sass" rel="stylesheet"/> <link href="/Content/TestScss.scss" rel="stylesheet"/> <script src="/Scripts/modernizr-2.5.3.js"></script> ... </head> <body> ... <script src="/Scripts/MicrosoftAjax.debug.js"></script> <script src="/Scripts/jquery-1.8.1.js"></script> <script src="/Scripts/jquery-ui-1.8.23.js"></script> <script src="/Scripts/jquery.validate.js"></script> <script src="/Scripts/jquery.validate.unobtrusive.js"></script> <script src="/Scripts/jquery.unobtrusive-ajax.js"></script> <script src="/Scripts/knockout-2.1.0.debug.js"></script> <script src="/Scripts/TestCoffeeScript.coffee"></script> </body> </html> 

Which greatly simplifies debugging client code.

But if you use preprocessors, then you may have problems when working in debug mode. The above code contains links to files with the extensions .less , .sass , .scss and .coffee . If HTTP handlers are not registered in the Web.config file for these extensions, then the contents of these files will be unprocessed and errors may occur on the client side.

To solve this problem, implementations of the corresponding HTTP handlers have been added to the translators library BundleTransformer.Less, BundleTransformer.LessLite, BundleTransformer.SassAndScss and BundleTransformer.CoffeeScript. When translators are installed via NuGet, HTTP handlers are registered in the Web.config file automatically:

 <?xml version="1.0" encoding="utf-8"?> <configuration> ... <system.web> ... <httpHandlers> <!-- Declaration of Bundle Transformer HTTP-handlers --> <add path="*.less" verb="GET" type="BundleTransformer.LessLite.HttpHandlers.LessAssetHandler, BundleTransformer.LessLite" /> <add path="*.sass" verb="GET" type="BundleTransformer.SassAndScss.HttpHandlers.SassAndScssAssetHandler, BundleTransformer.SassAndScss" /> <add path="*.scss" verb="GET" type="BundleTransformer.SassAndScss.HttpHandlers.SassAndScssAssetHandler, BundleTransformer.SassAndScss" /> <add path="*.coffee" verb="GET" type="BundleTransformer.CoffeeScript.HttpHandlers.CoffeeScriptAssetHandler, BundleTransformer.CoffeeScript" /> <!-- /Declaration of Bundle Transformer HTTP-handlers --> </httpHandlers> </system.web> <system.webServer> ... <handlers> ... <!-- Declaration of Bundle Transformer HTTP-handlers --> <add name="LessAssetHandler" path="*.less" verb="GET" type="BundleTransformer.LessLite.HttpHandlers.LessAssetHandler, BundleTransformer.LessLite" resourceType="File" preCondition="" /> <add name="SassAssetHandler" path="*.sass" verb="GET" type="BundleTransformer.SassAndScss.HttpHandlers.SassAndScssAssetHandler, BundleTransformer.SassAndScss" resourceType="File" preCondition="" /> <add name="ScssAssetHandler" path="*.scss" verb="GET" type="BundleTransformer.SassAndScss.HttpHandlers.SassAndScssAssetHandler, BundleTransformer.SassAndScss" resourceType="File" preCondition="" /> <add name="CoffeeScriptAssetHandler" path="*.coffee" verb="GET" type="BundleTransformer.CoffeeScript.HttpHandlers.CoffeeScriptAssetHandler, BundleTransformer.CoffeeScript" resourceType="File" preCondition="" /> <!-- /Declaration of Bundle Transformer HTTP-handlers --> </handlers> </system.webServer> ... </configuration> 

The only exception is the NuGet BundleTransformer.Less package: during its installation, the dotless package is also installed, which automatically registers its version of the HTTP handler for processing files with the .less extension. But you always have the opportunity to manually replace it with the HTTP LessAssetHandler from BundleTransformer.Less.

You can manage the settings of native HTTP headers for translators using the configuration element /configuration/bundleTransformer/core/assetHandler from the Web.config file. The following code shows the default HTTP handler settings:

 <configuration> ... <bundleTransformer xmlns="http://tempuri.org/BundleTransformer.Configuration.xsd"> <core> ... <assetHandler clientCacheDurationInDays="365" enableCompression="true" useLastModifiedHeader="true" useETagHeader="true" serverCacheDurationInMinutes="15" useServerCacheSlidingExpiration="false" disableClientCacheInDebugMode="true" disableCompressionInDebugMode="true" /> ... </core> </bundleTransformer> ... </configuration> 

Where,

Translators


Bundle Transformer: LESS Lite


At the end of April, a lightweight version of the dotless library called DotlessClientOnly appeared . This library contains only the LESS compiler, and all the functionality associated with ASP.NET has been removed from it (for example, an HTTP handler).

BundleTransformer.LessLite uses the features of DotlessClientOnly to translate LESS code into CSS. By features and software interface BundleTransformer.LessLite is fully equivalent to BundleTransformer.Less . Therefore, if in your projects all work with LESS is done only through Bundle Transformer, then it is better to use the BundleTransformer.LessLite module, since it is based on a more lightweight library.

Bundle Transformer: CoffeeScript


Up to version 1.5.5 in BundleTransformer.CoffeeScript , the SassAndCoffee.JavaScript version 2.0.2.0 library was used to translate the CoffeeScript code into JavaScript. Unfortunately, the SassAndCoffee.JavaScript library has not been developed for a long time and supports the outdated version of CoffeeScript (version 1.1.3). Therefore, in new versions of BundleTransformer.CoffeeScript, it had to be abandoned and implemented its own compiler that supports CoffeeScript 1.3.3.

Minimizers


The main task in creating the Bundle Transformer was to provide the developer with a choice of several minimizers. In earlier versions of the product, adapters were available to the developer for only 2 families of minimizers: Microsoft Ajax Minifier and YUI Compressor . In the current version, adapters are available for almost all popular CSS and JS code minimizers.

Bundle Transformer: Closure


BundleTransformer.Closure contains 2 minimizers of JS code: ClosureRemoteJsMinifier and ClosureLocalJsMinifier . ClosureRemoteJsMinifier minimizes using the Google Closure Compiler Service API web service and requires a constant connection to the Internet. ClosureLocalJsMinifier minimizes using the console application of Google Closure Compiler Application , and requires for its work: the Java virtual machine and the latest version of the compiler.jar file.

Bundle Transformer: JSMin


BundleTransformer.JsMin contains a JS code-minimizing adapter CrockfordJsMinifier . CrockfordJsMinifier based on the C # port of the oldest JS code minimizer , JSMin , which was written by Douglas Crockford. The used C # port was created based on the May 22, 2007 version of JSMin.

Bundle Transformer: UglifyJS


BundleTransformer.UglifyJs contains the minimizing adapter JS-code UglifyJsMinifier . UglifyJsMinifier created based on the minimizer of JS-code popular in the Node.js community - UglifyJS (version 1.3.3 is now supported).

Bundle Transformer: Packer


BundleTransformer.Packer contains the EdwardsJsMinifier JS code EdwardsJsMinifier . EdwardsJsMinifier is based on the JS minimizer Dean Edwards (Dean Edwards) Packer version 3.0. The main feature of Packer is that in addition to minimizing and obfuscating the code, it can also compress the code using the Base62 algorithm. Base62 compression can be used when GZIP / Deflate compression is not supported on the web server.

Bundle Transformer: CSSO


BundleTransformer.Csso contains the KryzhanovskyCssMinifier CSS minimizer adapter. KryzhanovskyCssMinifier based on the CSS CSSO minimizer (version 1.2.18 is currently supported). This minimizer was created by the developers of the BEM methodology: Sergey Kryzhanovsky and Vitaly Kharisov. The main difference between this CSS minimizer and other means of minimizing CSS code is to support structural minimization (for example, with the CSS code, the following operations are performed: merging blocks with the same selectors, removing overlapped properties, partially selecting properties into a separate block, partially merging blocks and etc.). Structural minimization gives a high degree of compression while minimizing the code generated by the “machine” (for example, a preprocessor).

I want to note one important point: CSSO is written in ECMAScript 5 and for a very long time I could not find a JS engine for .NET that could correctly execute the code of this library. In the end, I opted for the implementation of the JS V8 engine for .NET - Noesis Javascript .NET . This engine is partially written on unmanaged code and has 2 versions: 32-bit and 64-bit. Because of this implementation feature, the BundleTransformer.Csso module was divided into 2 NuGet packages: BundleTransformer.Csso.x86 and BundleTransformer.Csso.x64 . For the correct operation of the Noesis Javascript .NET, the msvcp100.dll and msvcr100.dll from Microsoft Visual C ++ 2010 are required. If your system does not have these assemblies, I recommend that you install Microsoft Visual C ++ 2010 Redistributable Package ( x86 , x64 ).

Bundle Transformer: WebGrease


BundleTransformer.WG contains the WgCssMinifier CSS minimizer WgCssMinifier . WgCssMinifier minimizes CSS code using a semantic CSS minimizer from the Microsoft-developed WebGrease library. Semantic CSS-minimizer WebGrease as well as CSSO produces structural minimization of CSS-code.

At the moment, the NuGet-BundleTransformer.WG package has alpha status, since The current version of WebGrease (version 1.1.0) contains an error and therefore cannot be used in production versions of sites.

If you want to learn more about this minimizer, then I recommend you to watch Howard Dorking 's video report “Bundling and Optimizing” .

Recommendations for the use of minimizers


The most reliable minimizers are the first three minimizers: Microsoft Ajax Minifier, YUI Compressor and Google Closure Compiler (the leader in JS code compression ratio). All of them have a good degree of compression, and the code processed by them is practically error free.

The new minimizers that were developed for Node.js: UglifyJS and CSSO give a higher compression ratio than the first three minimizers (UglifyJS in some cases compresses better than the Google Closure Compiler in Simple mode), but do not yet have such a level of reliability .

The oldest minimizers are JSMin and Packer, now they are only suitable for compressing the simplest JS code. Unfortunately, they lose to modern minimizers in terms of compression and reliability.

I did not compare the semantic minimizer of CSS-code WebGrease with other minimizers because of the specifics of the error contained in it. But according to general observations, it seems to me that it has a greater degree of code compression than CSSO.

Settings


The current Bundle Transformer settings are equivalent to the following version of the Web.config file (in the case that all the optional modules are installed):

 <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <!-- Declaration of Bundle Transformer configuration section group --> <sectionGroup name="bundleTransformer"> <section name="core" type="BundleTransformer.Core.Configuration.CoreSettings" /> <section name="less" type="BundleTransformer.LessLite.Configuration.LessLiteSettings" /> <section name="sassAndScss" type="BundleTransformer.SassAndScss.Configuration.SassAndScssSettings" /> <section name="microsoftAjax" type="BundleTransformer.MicrosoftAjax.Configuration.MicrosoftAjaxSettings" /> <section name="yui" type="BundleTransformer.Yui.Configuration.YuiSettings" /> <section name="closure" type="BundleTransformer.Closure.Configuration.ClosureSettings" /> <section name="uglify" type="BundleTransformer.UglifyJs.Configuration.UglifySettings" /> <section name="packer" type="BundleTransformer.Packer.Configuration.PackerSettings" /> <section name="csso" type="BundleTransformer.Csso.Configuration.CssoSettings" /> </sectionGroup> <!-- /Declaration of Bundle Transformer configuration section group --> ... </configSections> ... <!-- Bundle Transformer configuration settings --> <bundleTransformer xmlns="http://tempuri.org/BundleTransformer.Configuration.xsd"> <core enableTracing="false" jsFilesWithMicrosoftStyleExtensions="MicrosoftAjax.js,MicrosoftMvcAjax.js, MicrosoftMvcValidation.js,knockout-$version$.js" useEnableOptimizationsProperty="true"> <css defaultMinifier="NullMinifier"> <minifiers> <add name="NullMinifier" type="BundleTransformer.Core.Minifiers.NullMinifier, BundleTransformer.Core" /> <add name="MicrosoftAjaxCssMinifier" type="BundleTransformer.MicrosoftAjax.Minifiers.MicrosoftAjaxCssMinifier, BundleTransformer.MicrosoftAjax" /> <add name="YuiCssMinifier" type="BundleTransformer.Yui.Minifiers.YuiCssMinifier, BundleTransformer.Yui" /> <add name="KryzhanovskyCssMinifier" type="BundleTransformer.Csso.Minifiers.KryzhanovskyCssMinifier, BundleTransformer.Csso" /> <add name="WgCssMinifier" type="BundleTransformer.WG.Minifiers.WgCssMinifier, BundleTransformer.WG" /> </minifiers> <translators> <add name="NullTranslator" type="BundleTransformer.Core.Translators.NullTranslator, BundleTransformer.Core" enabled="false" /> <add name="LessTranslator" type="BundleTransformer.LessLite.Translators.LessTranslator, BundleTransformer.LessLite" enabled="true" /> <add name="SassAndScssTranslator" type="BundleTransformer.SassAndScss.Translators.SassAndScssTranslator, BundleTransformer.SassAndScss" enabled="true" /> </translators> </css> <js defaultMinifier="NullMinifier"> <minifiers> <add name="NullMinifier" type="BundleTransformer.Core.Minifiers.NullMinifier, BundleTransformer.Core" /> <add name="MicrosoftAjaxJsMinifier" type="BundleTransformer.MicrosoftAjax.Minifiers.MicrosoftAjaxJsMinifier, BundleTransformer.MicrosoftAjax" /> <add name="YuiJsMinifier" type="BundleTransformer.Yui.Minifiers.YuiJsMinifier, BundleTransformer.Yui" /> <add name="ClosureRemoteJsMinifier" type="BundleTransformer.Closure.Minifiers.ClosureRemoteJsMinifier, BundleTransformer.Closure" /> <add name="ClosureLocalJsMinifier" type="BundleTransformer.Closure.Minifiers.ClosureLocalJsMinifier, BundleTransformer.Closure" /> <add name="CrockfordJsMinifier" type="BundleTransformer.JsMin.Minifiers.CrockfordJsMinifier, BundleTransformer.JsMin" /> <add name="UglifyJsMinifier" type="BundleTransformer.UglifyJs.Minifiers.UglifyJsMinifier, BundleTransformer.UglifyJs" /> <add name="EdwardsJsMinifier" type="BundleTransformer.Packer.Minifiers.EdwardsJsMinifier, BundleTransformer.Packer" /> </minifiers> <translators> <add name="NullTranslator" type="BundleTransformer.Core.Translators.NullTranslator, BundleTransformer.Core" enabled="false" /> <add name="CoffeeScriptTranslator" type="BundleTransformer.CoffeeScript.Translators.CoffeeScriptTranslator, BundleTransformer.CoffeeScript" enabled="true" /> </translators> </js> <assetHandler clientCacheDurationInDays="365" enableCompression="true" useLastModifiedHeader="true" useETagHeader="true" serverCacheDurationInMinutes="15" useServerCacheSlidingExpiration="false" disableClientCacheInDebugMode="true" disableCompressionInDebugMode="true" /> </core> <less useNativeMinification="false" severity="0" /> <sassAndScss useNativeMinification="false" /> <microsoftAjax> <css allowEmbeddedAspNetBlocks="false" colorNames="Strict" commentMode="Important" ignoreErrorList="" indentSize="4" minifyExpressions="true" outputMode="SingleLine" blocksStartOnSameLine="NewLine" preprocessorDefineList="" termSemicolons="false" severity="0" /> <js allowEmbeddedAspNetBlocks="false" collapseToLiteral="true" debugLookupList="Debug,$Debug,WAssert,Msn.Debug,Web.Debug" evalTreatment="Ignore" ignoreConditionalCompilation="false" ignoreErrorList="" indentSize="4" inlineSafeStrings="true" knownGlobalNamesList="" localRenaming="CrunchAll" macSafariQuirks="true" minifyCode="true" noAutoRenameList="$super" outputMode="SingleLine" blocksStartOnSameLine="NewLine" preprocessorDefineList="" preserveFunctionNames="false" preserveImportantComments="true" removeFunctionExpressionNames="true" removeUnneededCode="true" renamePairs="" strictMode="false" stripDebugStatements="true" termSemicolons="false" severity="0"/> </microsoftAjax> <yui> <css compressionType="Standard" removeComments="true" lineBreakPosition="-1" /> <js compressionType="Standard" obfuscateJavascript="true" preserveAllSemicolons="false" disableOptimizations="false" ignoreEval="false" severity="0" lineBreakPosition="-1" encoding="UTF8" threadCulture="en-us" /> </yui> <closure> <js> <remote closureCompilerServiceApiUrl="http://closure-compiler.appspot.com/compile" compilationLevel="Simple" prettyPrint="false" excludeDefaultExterns="false" severity="0" /> <local javaVirtualMachinePath="" closureCompilerApplicationPath="" compilationLevel="Simple" prettyPrint="false" languageSpec="EcmaScript3" thirdParty="true" processJqueryPrimitives="false" processClosurePrimitives="false" severity="0" /> </js> </closure> <uglify> <js> <parser strictSemicolons="false" /> <mangler mangle="true" topLevel="false" defines="" except="" noFunctions="false" /> <squeezer makeSequences="true" deadCode="true" unsafe="false" /> <codeGenerator beautify="false" indentStart="0" indentLevel="4" quoteKeys="false" spaceColon="false" asciiOnly="false" /> </js> </uglify> <packer> <js shrinkVariables="true" base62Encode="false" /> </packer> <csso> <css disableRestructuring="false" /> </csso> </bundleTransformer> <!-- /Bundle Transformer configuration settings --> ... </configuration> 

In the previous review I have already described the structure of the configuration section bundleTransformer, so this time I will confine myself to listing the new sections:

The names and possible values ​​of the properties of the configuration sections listed above also need no explanation, since almost completely coincide with the configuration properties of the original minimizers. I also remind you that bundleTransformerIntelliSense support is implemented for the configuration section :

IntelliSense support when editing the bundleTransformer configuration section in the Web.config file

Conclusion


In conclusion, I would like to point out some important points regarding B / M and the Bundle Transformer.

Many people think that B / M can only work with ASP.NET MVC, but it is not. You can use B / M in other ASP.NET frameworks: Web Forms and Web Pages (in the links section there are articles that explain how this can be done).

The current versions of B / M and Bundle Transformer are written under the .NET Framework 4.0, so nothing prevents you from using them in ASP.NET MVC 3 and ASP.NET Web Forms 4.0.

Links


  1. CodePlex Bundle Transformer page
  2. Microsoft ASP.NET Web Optimization Framework page on CodePlex
  3. Howard Dorking video report "Bundling and Optimizing"
  4. - «Build high-performing HTML 5 applications easily with ASP.NET 4.5»
  5. «Bundling and Minification»
  6. «Adding Bundling and Minification to Web Forms» ( )
  7. «Adding Web Optimization to a Web Pages Site» ( )
  8. «Keeping in touch with the Web optimization team»

Source: https://habr.com/ru/post/152051/


All Articles