git.iko.soy/ghcjs-optimizer
on main help sign in
configurable js path and copy all files
commit958eee5a283cb7d4968e25c1fd72117aa03ea0f5 authoriko <ilyakooo0@gmail.com> dateWed 13 Oct 2021, 19:40 (5 years ago) parentafcb48e
1 file changed+6−1
default.nix+6−1
default.nix+6−1
@@ -3,6 +3,7 @@
33, zopfli ? pkgs.zopfli
44, useZopfli ? true
55, preserveHTML ? false
6+, allJsPath ? "/bin/*/all.js"
67}:
78input:
89pkgs.runCommand "${input.name}-optimized"
@@ -12,9 +13,13 @@ pkgs.runCommand "${input.name}-optimized"
1213
1314 cp ${if preserveHTML then "${input}/bin/*/index.html" else ./index.html} $out/index.html
1415
16+ cp -afv ${input}/* $out
17+
1518 chmod +w -R $out
1619
17− ${closurecompiler}/bin/closure-compiler --compilation_level ADVANCED --jscomp_off=checkVars --warning_level QUIET --js ${input}/bin/*/all.js --externs ${input}/bin/*/all.js.externs --js_output_file $out/all.js
20+ rm $out${allJsPath} $out${input}${allJsPath}.externs $out/all.js $out/all.js.externs || true
21+
22+ ${closurecompiler}/bin/closure-compiler --compilation_level ADVANCED --jscomp_off=checkVars --warning_level QUIET --js ${input}${allJsPath} --externs ${input}${allJsPath}.externs --js_output_file $out/all.js
1823
1924 ${ if useZopfli then "${zopfli}/bin/zopfli $out/**/*.{js,css,json,html}" else "" }
2025''