This project has moved and is read-only. For the latest updates, please go here.

Dynamically set configuration in code?

Mar 13, 2014 at 3:55 PM
Is there a way to set up the engine configuration in code rather than in a config file?

I more or less want to convert this into code:
<bundleTransformer xmlns="http://tempuri.org/BundleTransformer.Configuration.xsd">
        <core>
            <css>
                <minifiers>
                    <add name="NullMinifier" type="BundleTransformer.Core.Minifiers.NullMinifier, BundleTransformer.Core" />
                </minifiers>
                <translators>
                    <add name="NullTranslator" type="BundleTransformer.Core.Translators.NullTranslator, BundleTransformer.Core" enabled="false" />
                <add name="LessTranslator" type="BundleTransformer.Less.Translators.LessTranslator, BundleTransformer.Less" /></translators>
            </css>
            <js>
                <minifiers>
                    <add name="NullMinifier" type="BundleTransformer.Core.Minifiers.NullMinifier, BundleTransformer.Core" />
                </minifiers>
                <translators>
                    <add name="NullTranslator" type="BundleTransformer.Core.Translators.NullTranslator, BundleTransformer.Core" enabled="false" />
          <add name="LessTranslator" type="BundleTransformer.Less.Translators.LessTranslator, BundleTransformer.Less" enabled="true" />
                </translators>
            </js>
        </core>
      <less useNativeMinification="false" ieCompat="true" strictMath="false" strictUnits="false" dumpLineNumbers="None">
      <jsEngine name="MsieJsEngine" />
    </less>
    </bundleTransformer>
Mar 13, 2014 at 5:17 PM
Hello, Perezt!

I recommend you to watch the overloaded versions of constructors of the CssTransformer and JsTransformer classes:

Image