2

Web Essentials is supposed to automatically generate source map files for JavaScript minified files as stated here on the project website.

However, for my minified files, I find only the sourcename.min.js file. The web site states that the option should be in Tools/Options, however I can't seem to find any related toggle to enable that feature under the Web Essentials node.

What am I missing here? Is there any work-around to enable the feature?

2 Answers 2

1

I think what you want has been moved into the "Bundler and Compiler" extension. Although you are correct in that the Web Essentials project website says map files can be generated, I think the site is out of date. Check out what is said at https://visualstudiogallery.msdn.microsoft.com/9ec27da7-e24b-4d56-8064-fd7e88ac1c40 where they talk about map files. It does say they're supposed to be autogenerated, but for my concerns (I wanted CSS map files generated) I had to modify the bundleconfig.json as described at the bottom of that page.

Sign up to request clarification or add additional context in comments.

5 Comments

i have this extension as well, what modification did you exactly do to obtain maps?
The bundleconfig.json file was added for me automatically, either when I installed the extension or when I compiled - I'm not sure. However, upon opening that file, I found it configured to compile two LESS files; one that I wanted, the other not. I removed the latter and added the properties to minify and map the former. i.e. [ { "outputFile": "Content/less/main.css", "inputFile": "Content/less/main.less", "minify": { "enabled": true }, "options": { "sourceMap": true } } ]
Interestingly, the Bundler and Compiler page says that mapping is only for javascript, yet that too is out of date as it's definitely mapping CSS files, for me.
so the part that did it is "options": { "sourceMap": true }. right?
Yes, that's what did it for me.
0

To enable source maps, add this property to the bundleconfig.json file:

"sourceMap": true

It says here in this link: https://marketplace.visualstudio.com/items?itemName=MadsKristensen.BundlerMinifier, under Source maps section.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.