我在我的C#项目中使用UglifyJS2作为Bundle Transformer NuGet包,我只是希望能够连接我的JS文件,而不会将它们缩减为我的QA环境,但我不能弄清楚该怎么做。有可能吗?
以下是Bundle Transformer的当前Web.config部分:
<bundleTransformer xmlns="http://tempuri.org/BundleTransformer.Configuration.xsd">
<core>
<css defaultMinifier="WgCssMinifier" usePreMinifiedFiles="true">
<translators>
<add name="NullTranslator" type="BundleTransformer.Core.Translators.NullTranslator, BundleTransformer.Core" enabled="false" />
<add name="SassAndScssTranslator" type="BundleTransformer.SassAndScss.Translators.SassAndScssTranslator, BundleTransformer.SassAndScss" />
</translators>
<postProcessors>
<add name="UrlRewritingCssPostProcessor" type="BundleTransformer.Core.PostProcessors.UrlRewritingCssPostProcessor, BundleTransformer.Core" useInDebugMode="false" />
</postProcessors>
<minifiers>
<add name="NullMinifier" type="BundleTransformer.Core.Minifiers.NullMinifier, BundleTransformer.Core" />
<add name="WgCssMinifier" type="BundleTransformer.WG.Minifiers.WgCssMinifier, BundleTransformer.WG" />
</minifiers>
<fileExtensions>
<add fileExtension=".css" assetTypeCode="Css" />
<add fileExtension=".sass" assetTypeCode="Sass" />
<add fileExtension=".scss" assetTypeCode="Scss" />
</fileExtensions>
</css>
<js defaultMinifier="UglifyJsMinifier" usePreMinifiedFiles="true">
<translators>
<add name="NullTranslator" type="BundleTransformer.Core.Translators.NullTranslator, BundleTransformer.Core" enabled="false" />
</translators>
<minifiers>
<add name="NullMinifier" type="BundleTransformer.Core.Minifiers.NullMinifier, BundleTransformer.Core" />
<add name="UglifyJsMinifier" type="BundleTransformer.UglifyJs.Minifiers.UglifyJsMinifier, BundleTransformer.UglifyJs" />
</minifiers>
<fileExtensions>
<add fileExtension=".js" assetTypeCode="JavaScript" />
</fileExtensions>
</js>
<assetHandler disableServerCache="false" serverCacheDurationInMinutes="15" disableClientCache="false" />
</core>
<uglify>
<js screwIe8="true" keepFunctionNames="false" severity="0">
<parsing strict="false" bareReturns="false" />
<compression compress="false" angular="true" />
<mangling mangle="false" />
<codeGeneration beautify="true" comments="all" />
</js>
<jsEngine name="V8JsEngine" />
</uglify>
<webGrease>
<css shouldMinify="true" ejectCharset="true" />
</webGrease>
答案 0 :(得分:1)
尝试以下设置:
<bundleTransformer xmlns="http://tempuri.org/BundleTransformer.Configuration.xsd">
<core>
...
<js defaultMinifier="NullMinifier" ...>
...
</js>
...
</core>
...
</bundleTransformer>