3
votes

I'm using google-code-prettify in an ASP.NET MVC 4 project. It works in debug mode but in release the minification/bundling step fails.

I get this error:

"Minification failed. Returning unminified contents. (104,399-436): run-time error JS5017: Syntax error in regular expression: /^(?:\r\n|[\S\s])[^\n\r#=A-[^`h{~]/"

The file it's complaining about is: lang-wiki.js

This is the latest version from google and it runs in debug so I can only assume the bundling is incorrectly parsing the regular expression.

Other than omitting this file what else can I do? Ideally I would like to disable any error checking the bundling step attempts.

I'm using these versions:

  • Microsoft.AspNet.Mvc.4.0.20710.0
  • Microsoft.AspNet.Web.Optimization.1.1.3

I tried minifying these files with YUI Compressor and it works so that seems to support the incorrect parsing theory.

1

1 Answers

0
votes

Some of minification tools such as google closure or YUI have different behavior on considering semi-colons and this cause some problems when a script is not well-formatted, while if you use grease or ajax-minifer which are tools from Microsoft, you won't see these type of problems.

Ajax-Minifer also has build scripts that may help you out performing some actions during build process as required.