1

I installed UglifyJS2 in my ASP MVC 4 Project in Visual Studio as command line tool and used it to uglify a js file i wrote. I need to keep the function names as they are so i set --keep-fnames. So far so good after i tried the following command i got my uglified file containing the function names: uglifyjs sample.js --compress --mangle --keep-fnames --output sample.min.js

But as soo as i edited the uncompressed file i recognized that there was a so called source map which automatically compresses the new version to the .min.js file.

I want to use this source map but the problem is it doesnt keep my function names of the original javascript file and i found no solution to set the compression options anywhere in this source map file, neither i found any soultion in the web...

EDIT

After a little bit of research i found out that the source map comes from an extension for visual studio (webessentials 2012). Still i did not found any documentation about how to config the source map (if it is even possible).

DavidVollmers
  • 620
  • 4
  • 15
  • `source map which automatically compresses the new version to the .min.js file.` I'm not sure I get that. Source map is just a file. It won't do anything automatically. I'm guessing your IDE watches your uncompressed file and runs `uglify` when it detects a change, with different options than you use in command line. – mostruash Jul 24 '15 at 10:59
  • Im using Visual Studio 2012 and i never worked with source maps. So my question should be how and where i can configure the compressing of the js file in VS? – DavidVollmers Jul 24 '15 at 11:12
  • I have no idea. You should edit your question to include those tags (e.g. Visual Studio etc.) But basically, source map is a file that helps your browser to show original uncompressed JS file in dev tools even when minified version is loaded (using ` – mostruash Jul 24 '15 at 15:27

0 Answers0