0

Consider the following scenario:

I use Web Essentials, thus my .less files get compiled into .css, .map en -min.css files. I also use MVC StyleBundles.

Expectation: In release builds, the StyleBundle "handler" bundles and minifies all the .css files defined in the bundle. (not the .min files)

Actual result: In release builds, the StyleBundle "handler" does bundle, but uses the .min files generated by Web Essentials, if found. Else wise is minifies the .css itself.

Can I configure the "handler" to ignore the generated .min files and always minify the .css files itself?

Deleting all present .map en -min.css files and generating a solution-wide Web Essentials setting in which I disable the generation of minified files and is not a feasible solution in my team.

Thanks!

5
  • That is not the solution I am looking for. In that case the StyleBundle handler still uses the -min.css file, if found. Commented May 29, 2015 at 9:42
  • gulp is just a way to do what you want with the granularity of control that you want in an easy, (possibly) scalable way Commented May 29, 2015 at 9:47
  • That way I would force my team to use Gulp too, thus force them to install node etc. Ain't gonna happen. Plus in this case the StyeBundle hander would still use the -min.css file and not the .css file. Moving away from Bundles neither is an option. Commented May 29, 2015 at 9:52
  • You can disable the minification in WebEssentials, and let the StyleBundle handle the minification (this is even better, always minify the final CSS/JS) Commented Jun 10, 2015 at 8:54
  • Sure, this works on my machine - but there is absolutely no guarantee that other developers on this project will have the same Web Essentials settings. Commented Jun 11, 2015 at 9:25

1 Answer 1

1

A quick and easy solution to this would be the following:

Web Essentials allows you to create a solution-wide settings file that can be checked into your version control system.

The option to create this file is under the Web Essentials menu that gets added when it gets installed.

Note: Some plugins may conflict with this and I've had one PC where the Web Essentials menu was missing even after several attempts to re-install.

Create solution settings

After you click this, it will create a file WebEssentials-Settings.json in your solution directory where you can customize settings that will get used by all of your team members when they load up the solution the next time.

To disable the automatic minification LESS files, just change the CompileOnBuild, CompileOnSave, and MinifyInPlace settings to false.

enter image description here

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.