-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 2 with CSS minifiers #4
Comments
Hello, John!
This error occurred, because you have removed the following settings: <?xml version="1.0" encoding="utf-8"?>
<configuration>
...
<bundleTransformer xmlns="http://tempuri.org/BundleTransformer.Configuration.xsd">
<core>
...
<js>
<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" />
</minifiers>
<fileExtensions>
<add fileExtension=".js" assetTypeCode="JavaScript" />
</fileExtensions>
</js>
...
</core>
...
</bundleTransformer>
...
</configuration>
This setting does not apply to the Bundle Transformer. JS engine needs to be specified for each specific module, but in your case I do not see modules, that require the JavaScript Engine Switcher library. Only the following modules require installation of the JavaScript Engine Switcher: Less, CoffeeScript, TypeScript, Hogan, Handlebars, Autoprefixer, Packer, UglifyJs, Csso and CleanCss.
I recommend you to read the “How to upgrade applications to version 2.X” section of the JavaScript Engine Switcher's documentation. Also see a |
Hi Taritsyn, Thanks for such a prompt reply and for sharing your hard work! I removed the configuration in the web.config as I interpreted the upgrade guide as saying that I had to from this line: "Now during configuration instead of the declarative approach (using the configuration file) is used in the imperative approach (using the program code)." I was using UglifyJs so I do think I need that. I'll have a look at the sample later on and replicate what's in there. Thank you! |
You misunderstood this text. This statement applies only to the JavaScript Engine Switcher library (in text even specified the configuration sections, that need to be removed). Bundle Transformer still uses a declarative approach (see the “Configuration settings” section of documentation).
Yes, this module requires installation of the JavaScript Engine Switcher library. |
This worked fine thanks. I had problems using Web Grease on Azure as an App Service. Will open a separate ticket to track that though |
Hi,
I have upgraded all packages to the latest versions but I'm struggling with the configuration side of things. I have moved the Javascript config into code:
`public static void Configure(JsEngineSwitcher engineSwitcher)
{
engineSwitcher.EngineFactories
//.AddChakraCore()
//.AddJint()
//
.AddMsie(new MsieSettings
{
UseEcmaScript5Polyfill = true,
UseJson2Library = true
});
// .AddV8();
I've left the CSS config in the web.config like this:
<bundleTransformer xmlns="http://tempuri.org/BundleTransformer.Configuration.xsd"> <core> <css defaultMinifier="WgCssMinifier"> <translators> <add name="NullTranslator" type="BundleTransformer.Core.Translators.NullTranslator, BundleTransformer.Core" enabled="false" /> </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" /> </fileExtensions> </css> </core> </bundleTransformer>
However, when I try to run my application I get a validation error on this line:
@Scripts.Render("~/bundles/admin/application/js")
These assets are not scripts: /Content/admin/theme/vendor/jquery/jquery-1.11.1.min.js, /Content/admin/theme/vendor/jquery/jquery_ui/jquery-ui.js, /Scripts/jquery.validate.min.js, /Scripts/jquery.validate.unobtrusive.min.js
The text was updated successfully, but these errors were encountered: