Download javascript and CSS minifier framework automatically

Does anyone know a good plugin for a game that automatically minimizes javascript and css for connecting to a playback playback server?

I found this one, but I think there are more:

https://github.com/greenlaw110/play-greenscript

The main problem that I see here is that when creating javascript on the game side, the plugin will have to detect the JS code that is generated on the fly. Mostly because I write the values ​​directly in javascript, for example:

function foo${handlerID}(someVar){ var x = ${some_val}; (...) } var t = foo${handlerID}('bar'); 
+2
javascript code-generation playframework minify
source share
2 answers

The reason we minimize / compress / combine for css / js / img is because we want to save network bandwidth and speed up application performance, reduce server load and make the user more happy.

When you put these groovy variables in your javascript code, you go to a different path, i.e. slow down the server. Since each request will receive a different javascript file to load, and the user will no longer use local cached copies of js. For the same reason, using greenscript or any other minimization tool for compression does not make sense, because each time you need to compress and combine again, and not get it directly from the cache.

If there are cases when you need to insert groovy variables into some javascript code, it is better to separate them from other parts (which should be reasonably larger than most). By doing this, you can still use greenscript or click to process your static js files and leave the dynamic parts in your view.

+4
source share

Check the press module . As long as the generated Javascript and css are in their own separate files, you should be able to automate them.

+3
source share

All Articles