Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a flag to run closure-compiler on the output #550

Open
neongreen opened this issue Oct 27, 2019 · 2 comments
Open

Add a flag to run closure-compiler on the output #550

neongreen opened this issue Oct 27, 2019 · 2 comments

Comments

@neongreen
Copy link

Currently I manually run closure-compiler all.js --compilation_level=ADVANCED_OPTIMIZATIONS --jscomp_off=checkVars --externs=all.js.externs > all.min.js after compiling my project with Nix. Would it make sense to have a flag to do this automatically?

@andgate
Copy link

andgate commented Oct 27, 2019

I came here to check for this specific issue. Additionally, I'd like for index.html to use all.min.js instead of lib.js, out.js, and rts.js.

@neongreen
Copy link
Author

In the meantime I figured out how to do it automatically, but a flag would still be nice.

  pkgs.stdenv.mkDerivation {
    inherit (foo) name version;
    buildCommand = ''
      mkdir -p $out
      cp ${foo}/bin/foo.jsexe/{rts,lib,out,runmain}.js $out
      ${pkgs.closurecompiler}/bin/closure-compiler \
        ${foo}/bin/foo.jsexe/all.js \
        --compilation_level=ADVANCED_OPTIMIZATIONS \
        --jscomp_off=checkVars \
        --externs=${foo}/bin/foo.jsexe/all.js.externs \
        > $out/all.min.js
    '';
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants