Comments (11)
I should also note - this works in DEV, but not in PROD. And yes, I have everything set to configure for usage, no matter the environment. There weren't any new "server" requirements, were there?
from webmarkupmin.
Hello, Christopher!
Are you using the following settings?
…
public class WebMarkupMinConfig
{
public static void Configure(WebMarkupMinConfiguration configuration)
{
configuration.AllowMinificationInDebugMode = true;
configuration.AllowCompressionInDebugMode = true;
…
It is also possible that errors occur when parsing HTML content. I recommend you to write your own logger or use the built-in logger (ThrowExceptionLogger
class). If you use ASP.NET Web Forms, then the logger for WebMarkupMin needs to be registered in the App_Start/WebMarkupMinConfig.cs
file as follows:
using WebMarkupMin.Core.Loggers;
…
DefaultLogger.Current = new ThrowExceptionLogger();
from webmarkupmin.
Hello, Christopher!
Did my advice help you?
from webmarkupmin.
from webmarkupmin.
By commenting out the following line, everything seems to work..
DefaultJsMinifierFactory.Current = new MsAjaxJsMinifierFactory();
from webmarkupmin.
Hello, Christopher!
Category: JS_MINIFICATION_ERROR
Message: Expected '(': {
File: /
Line number: 772
Column number: 19
Source fragment:
Line 771: }
Line 772: catch {
-----------------------------^
Line 773: //debugger;
It seems that JS minifier perceives the catch
block without a exception value as syntax error.
It expects instead of this line:
catch {
Expects the following line:
catch (e) {
If you are using the WebMarkupMin.MsAjax or WebMarkupMin.Yui module, then replace it with a more modern module - WebMarkupMin.NUglify:
from webmarkupmin.
Will do - thanks for the fast reply. I'm actually using the latest 2.14.0 from NuGet. Does that not have that latest module?
from webmarkupmin.
After installing the WebMarkupMin.NUglify module, this line:
DefaultJsMinifierFactory.Current = new MsAjaxJsMinifierFactory();
Need to be replaced with the following line:
DefaultJsMinifierFactory.Current = new NUglifyJsMinifierFactory();
from webmarkupmin.
I'm actually using the latest 2.14.0 from NuGet. Does that not have that latest module?
Microsoft Ajax Minifier and YUI Compressor for .NET libraries have been deprecated.
It looks like you are using a WebMarkupMin.MsAjax module. Uninstall the WebMarkupMin.MsAjax package and then install the WebMarkupMin.NUglify package. Replace the corresponding namespaces and update the code as in the previous post.
from webmarkupmin.
That did it! Thank you so much. By the way, do you have a minification setting in here for *.svg?
from webmarkupmin.
The WebMarkupMin does not have an SVG minifier.
If SVG code is embedded in HTML code, then it is minified according to rules similar to XML minification.
For individual .svg
files, you can use an XML minifier (embedded scripts and styles will not be modified). But .svg
files are static files and the WebMarkupMin.AspNet4.WebForms module will not work for them. For static files, you will need a WebMarkupMin.AspNet4.HttpModules module with XmlMinificationModule
and may require special IIS configuration.
from webmarkupmin.
Related Issues (20)
- problem dont use Quotes in Html Attribute HOT 2
- [WebMarkupMin.AspNetCore5] Sometimes a blank page is returned as the request has no response data available HOT 30
- Minified attributes seem to be double encoded HOT 4
- More a question, not an "issue" HOT 9
- .NET 7 broke BrotliCompressor due to invalid compression levels HOT 4
- ArgumentNullException: Value cannot be null. (Parameter 'destination') HOT 4
- Hmmm… can't reach this page It looks like the webpage HOT 1
- object ref error with WebMarkupMin.AspNetCore7. HOT 3
- Whitespace trimming on anchor tags (when using svg tag) HOT 28
- Minification Failing - GTM no script tags breaking minification HOT 5
- The minifier does not compress the content if there is code in the html HOT 2
- DotNet 8 support HOT 3
- <button> type attribute with "submit" value is removed HOT 1
- XML minification HOT 6
- Question regarding asp.net webforms > .ascx HOT 9
- Unclosed td / th tags on PartialView HOT 2
- Invalid HTML Minification Result HOT 2
- .NET 6 -> .NET 8 (Markup minification not working) HOT 1
- Encoding in HtmlAttributeValueHelpers breaks Third Party JS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webmarkupmin.