GuillaumeGomez / minifier-rs

Minifier tool/lib for JS/CSS/JSON files
MIT License
86 stars 16 forks source link

Run js minifier on <script> content in html minifier #5

Open GuillaumeGomez opened 7 years ago

frewsxcv commented 7 years ago

I don't think you can assume that everything inside <script> is JavaScript

GuillaumeGomez commented 7 years ago

Only on type=text/javascript I suppose. The same goes for <style>.

frewsxcv commented 7 years ago

I don't think you can make any assumptions about the body of <script> or <style>. Even if I do <script type='text/javascript'> one can still put invalid JavaScript in there

GuillaumeGomez commented 7 years ago

Hum, I guess. Would be great though...

frewsxcv commented 7 years ago

In general, I suggest copying what other minifiers are doing instead of making up what you think works. I also suggest copying their test cases.