bundle/minify in web forms

mikha
mikha used Ask the Experts™
on
Has anyone implemented bundling and minification in asp.net web forms.
I found multiple examples on how do it in asp.net MVC but nothing on asp.net web forms.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Chief Technology Ninja
Distinguished Expert 2018
Commented:
Hi mikha,

Here is a step by step guide of doing the same: https://blogs.msdn.microsoft.com/rickandy/2012/08/14/adding-bundling-and-minification-to-web-forms/

The central idea is still the same.
1. Create/Define your bundle
2. Register it in Application_Start
3. Reference bundles using Script.Render

Regards,
Chinmay.

Author

Commented:
thanks chinmay - I was able to follow and implement the bundling.
only thing I got stuck on was , for styles bundle , i had an import statement in my css file to import fonts as such

@import url('https://fonts.googleapis.com/css?family=Lucida+Sans');

bundler and minifier didn't like it, since this is related issue, should i just copy the css that is on the url above and copy it into a new css file and include that for minification?
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018

Commented:
Hi mikha,

Yes. That is one way to solve it.

Regards,
Chinmay.

Author

Commented:
Thanks chinmay. That works for me , but now curious as what other way we can solve it ?
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018

Commented:
I knew this question would come. Mostly I am sure I could tweak થ @import statement to work with bundling however I am currently not able to do so.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial