开发者

Minify JavaScript code through C# - ASP.NET [duplicate]

This question already has answers here: Elegantly minify dynamically generated javascript in a .NET environment? [closed] (6 answers) Closed 4 years ago.

I'm trying to wr开发者_如何学运维ite a templated user control that get's as a template the js code from the user,

And minifies it on the fly (OnInit), and actually prints the minified JS.

That means that I need a code that receives a string, and returns a string.

All I found untill know are programs that uses the input \ output from the hard-drive, something that I can't allow.

Is there any C# Libraries relevant to my issue \ need ?

Thanks all.

EDIT:

When I say minify, I just meen removing comments, spaces and obfuscation.


Cached JavaScript minification on the fly – ASP.NET and HttpHandler


This was answered over in another answer about a year later and it's a bit more elegant:

https://stackoverflow.com/a/8573261/128795

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜