Skip to content

Spike js optimization helper using closure compiler

Marek Fajkus requested to merge turboMaCk/Shpadoinkle:js-optimize into master

addresses #30 (closed)

this is at prototype stage but I will need feedback regarding naming, place etc.

to test this locally:

  1. Build examples with flag:
$ nix-build examples --arg isJS true --arg optimizeJS true
  1. 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
  1. 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

Merge request reports