Spike js optimization helper using closure compiler
addresses #30 (closed)
this is at prototype stage but I will need feedback regarding naming, place etc.
to test this locally:
- Build examples with flag:
$ nix-build examples --arg isJS true --arg optimizeJS true
- Create new index.html that includes optimized files
$ cat <<EOF > index.html
<!DOCTYPE html>
<html>
<body>
<script language="javascript" src="result-6/bin/todomvc.jsexe/all.js.min.js"></script>
</body>
</html>
EOF
- Open index in browser
# linux
$ xdg-open index.html
# macos
$ open index.html
Notes
- only
all.js
is working - it's quite expensive to optimize all js files - we should probably run this only on
all.js
as that's the only one working anyway - code needs to be refactored
-
all.js.min.js
is not the nicest name - we might want to strip original.js
and replace it with.min.js
Edited by Marek Fajkus