2, closurecompiler ? pkgs.closurecompiler
4, fileExtentionsToZopfli ? [ "js" "css" "json" "html" ]
6, filesToCopy ? { "" = "*"; }
7, copyInsteadOfOptimizeJs ? false
11 flattenDirAttrSet' = prfx: x:
14 then concatLists (pkgs.lib.mapAttrsToList (p: v: flattenDirAttrSet' (prfx + "/" + p) v) x)
15 else [{ p = prfx; v = x; }];
16 flattenDirAttrSet = name: x:
18 then (flattenDirAttrSet' "" x)
19 else builtins.throw "${name} should be an attribute set.";
22 flattenFileTree = name: x: builtins.map ({ p, v }: p + "/" + v) (flattenDirAttrSet name x);
24 filesToList = name: x:
26 then flattenFileTree x
27 else if builtins.isList x
29 else builtins.throw "${name} should be either a list or an attribute set.";
30 jsToOptimizeList = flattenDirAttrSet "jsToOptimize" jsToOptimize;
32pkgs.runCommand "${input.name}-optimized"
42 builtins.concatStringsSep "\n"
43 (builtins.map ({p, v}: "cp -afv ${v} $out${p}")
44 (flattenDirAttrSet "filesToCopy" filesToCopy ++
45 pkgs.lib.optionals copyInsteadOfOptimizeJs jsToOptimizeList))
51 pkgs.lib.optionalString (!copyInsteadOfOptimizeJs)
52 (builtins.concatStringsSep "\n"
53 (builtins.map ({p, v}:
59 ${closurecompiler}/bin/closure-compiler --compilation_level ADVANCED --jscomp_off=checkVars --warning_level QUIET --js ${input}/${i} --externs ${input}/${i}.externs --js_output_file $out${o}
65 if fileExtentionsToZopfli != []
66 then "${zopfli}/bin/zopfli $out/**/*.{${builtins.concatStringsSep "\n" fileExtentionsToZopfli}}"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list