Google Closure Compiler: Difference between revisions
Jump to navigation
Jump to search
Line 83: | Line 83: | ||
| valign="top" | | | valign="top" | | ||
* [https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler Google Closure Compiler » Annotating JavaScript] | |||
* [https://github.com/jgraph/drawio/blob/dev/etc/build/build.xml Google Closure Compiler » Example by DrawIO] | * [https://github.com/jgraph/drawio/blob/dev/etc/build/build.xml Google Closure Compiler » Example by DrawIO] | ||
* [https://github.com/jgraph/drawio/blob/dev/etc/build/build.xml Google Closure Compiler » Ant Task Example] | * [https://github.com/jgraph/drawio/blob/dev/etc/build/build.xml Google Closure Compiler » Ant Task Example] | ||
Line 88: | Line 89: | ||
* [https://developers.google.com/closure/compiler/docs/gettingstarted_app Google Closure Compiler » Getting Started] | * [https://developers.google.com/closure/compiler/docs/gettingstarted_app Google Closure Compiler » Getting Started] | ||
* [https://chromium.googlesource.com/chromium/blink/+/master/Source/devtools/scripts/closure/README.md Google Closure Compiler » Readme] | * [https://chromium.googlesource.com/chromium/blink/+/master/Source/devtools/scripts/closure/README.md Google Closure Compiler » Readme] | ||
* [https://github.com/wro4j/wro4j-examples WRO4J Example] | * [https://github.com/wro4j/wro4j-examples WRO4J Example] | ||
* [[Rhino]] | * [[Rhino]] | ||
Line 99: | Line 99: | ||
* [[JavaScript Proprietary Library Example]] | * [[JavaScript Proprietary Library Example]] | ||
* [[JavaScript Ali Express Discounted Cart]] | * [[JavaScript Ali Express Discounted Cart]] | ||
* [https://stackoverflow.com/questions/939326/ Execute JavaScript without Eval] | |||
* [[JSON Schema Validation]] | * [[JSON Schema Validation]] | ||
* [https://github.com/jgraph/drawio-desktop DrawIO Desktop] | * [https://github.com/jgraph/drawio-desktop DrawIO Desktop] |
Revision as of 23:12, 9 July 2022
sudo wget -c https://dl.google.com\
/closure-compiler/compiler-20200719.zip -P /opt/cli/
sudo mkdir -p /opt/cli/closure-compiler-20200719
sudo unzip -q /opt/cli/compiler-20200719.zip -d /opt/cli/closure-compiler-20200719
sudo rm -rf /opt/cli/compiler-20200719.zip
sudo chmod 644 /opt/cli/closure-compiler-20200719/closure-compiler-v20200719.jar
sudo mkdir -p /opt/cli/closure-compiler-20200719/bin
sudo touch /opt/cli/closure-compiler-20200719/bin/closure-compiler
sudo chmod +x /opt/cli/closure-compiler-20200719/bin/closure-compiler
sudo tee -a /opt/cli/closure-compiler-20200719/bin/closure-compiler >/dev/null <<'EOF'
#!/bin/bash
: '
@vendor Chorke Academia, Inc.
@web https://cdn.chorke.org/docs/academia
@version 1.0.00
@since 1.0.00
'
export CLOSURE_COMPILER_HOME='/opt/cli/closure-compiler-20200719'
export CLOSURE_COMPILER_EXEC="java -jar ${CLOSURE_COMPILER_HOME}/closure-compiler-v20200719.jar"
if [ -f "${JAVA_HOME}/bin/java" ];then ${JAVA_HOME}/bin/${CLOSURE_COMPILER_EXEC}
elif [ -x "$(command -v java)" ];then ${CLOSURE_COMPILER_EXEC}
else printf '\njava \033[0;31mnot found! \033[0m:(\n';fi
EOF
sudo update-alternatives --install /usr/bin/closure-compiler closure-compiler\
/opt/cli/closure-compiler-20200719/bin/closure-compiler 1983
Web Install
sudo apt -qq update;\
bash <(curl -s 'https://cdn.chorke.org/exec/cli/bash/install/closure-compiler/20200719.sh.txt')
Examples
closure-compiler
:'
The compiler is waiting for input via stdin.
function greeting(name){return 'Hi '+name+', Eid Mubarak';};
function greeting(a){return"Hi "+a+", Eid Mubarak"};
'
closure-compiler
:'
The compiler is waiting for input via stdin.
var greeting=(name)=>'Hi '+name+', Eid Mubarak';
var greeting=function(a){return"Hi "+a+", Eid Mubarak"};
'
Knowledge
sudo chmod +x /opt/cli/closure-compiler-20200719/closure-compiler-v20200719.jar
stat -c '%a' /opt/cli/closure-compiler-20200719/closure-compiler-v20200719.jar
stat /opt/cli/closure-compiler-20200719/closure-compiler-v20200719.jar
References
| ||