I have a project that works that works as a subapplication on a site (actually multiple sites). Among other things, I have several static css and js files in this project. I need to keep those as separate js and css files, but to keep google happy, I'd like to minify those. Those files are likely to be modified in the future, so I'd like to avoid manually minifying them every time they are changed.
Is there some option that would allow me to minify those files on compile or publish (other than writing build events to minify those files using external tools).
The following pertains to VS2015, which has much better support for this scenario.
VS2015 introduces support for task runners like gulp or grunt. You could use one of those, and have a task triggered on project open (i.e. always runs while you're working on the project) which will itself monitor for file changes and run the minimizer (i.e. do it on save).
An intro to gulp in VS2015 is available here.
A simpler alternative on VS2015 is to use the Web Compiler Extension, which basically does the above automagically with less work on your side to set it up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With