I have a weird issue related to JavaScript minification, the problem is that when placing JavaScript files such as test1.js, test2.js inside /assets/javascript/test
folder and using following options for closure piler:
val defaultOptions = new CompilerOptions()
defaultOptions.closurePass = true
defaultOptions.setProcessCommonJSModules(false)
defaultOptions.setPrettyPrint(true)
CompilationLevel.WHITESPACE_ONLY.setOptionsForCompilationLevel(defaultOptions)
They get minified, but this will cause both test1.min.js and test2.min.js files to share same codes as minified... this will cause some additional JavaScript bugs when files are used within same pages and takes up more disk space.
However, if CompilerOptions
is not set, JavaScript piles properly without duplication but the pilation level is too strict and our JavaScript stops working because it says errors about some things written in those files. Overall, minification process is activated too late to fix all project js files to go through with default piler options so only option now is to configure it to work in a way which use light minification but without js duplication.. any help on this issue will be highly appreciated!
I'm using Play Framework 2.1.1 with Java project.
I have a weird issue related to JavaScript minification, the problem is that when placing JavaScript files such as test1.js, test2.js inside /assets/javascript/test
folder and using following options for closure piler:
val defaultOptions = new CompilerOptions()
defaultOptions.closurePass = true
defaultOptions.setProcessCommonJSModules(false)
defaultOptions.setPrettyPrint(true)
CompilationLevel.WHITESPACE_ONLY.setOptionsForCompilationLevel(defaultOptions)
They get minified, but this will cause both test1.min.js and test2.min.js files to share same codes as minified... this will cause some additional JavaScript bugs when files are used within same pages and takes up more disk space.
However, if CompilerOptions
is not set, JavaScript piles properly without duplication but the pilation level is too strict and our JavaScript stops working because it says errors about some things written in those files. Overall, minification process is activated too late to fix all project js files to go through with default piler options so only option now is to configure it to work in a way which use light minification but without js duplication.. any help on this issue will be highly appreciated!
I'm using Play Framework 2.1.1 with Java project.
Share Improve this question edited Apr 2, 2014 at 19:11 Charles 51.5k13 gold badges106 silver badges144 bronze badges asked Sep 6, 2013 at 12:28 Mauno VähäMauno Vähä 9,7883 gold badges35 silver badges55 bronze badges 3- 1 Did you ever find an answer to this? – shuttj Commented Jan 2, 2014 at 22:50
- 1 After more digging, I found this issue for play 2.2.1: github./playframework/playframework/issues/2192 – shuttj Commented Jan 3, 2014 at 3:47
- 1 Yea, I haven't had time to work it with lately, although we came up with some seriously big hack to workaround this issue, if 2.2.1 has it fixed it would be worth to try and accept it as solution instead. – Mauno Vähä Commented Jan 3, 2014 at 7:54
2 Answers
Reset to default 1It seems that this topic has generated some interests, I wan't to point out that I couldn't reproduce this problem after upgrading to play version 2.2.2
. So I will be accepting this as a solution because it seems less hacky way to fix it.
Upgrade the Play Framework to 2.2.2
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744752319a4591670.html
评论列表(0条)