Commit 5e9393a8 authored by Michael Droettboom's avatar Michael Droettboom

Fix #37: Minify Javascript

parent b1233f35
......@@ -17,7 +17,7 @@ jobs:
# Set up the Debian testing repo, and then install g++ from there...
sudo bash -c "echo \"deb http://ftp.us.debian.org/debian testing main contrib non-free\" >> /etc/apt/sources.list"
sudo apt-get update
sudo apt-get install node-less cmake build-essential clang-format-6.0 flake8
sudo apt-get install node-less cmake build-essential clang-format-6.0 flake8 uglifyjs
sudo apt-get install -t testing g++-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 80 --slave /usr/bin/g++ g++ /usr/bin/g++-8
......
......@@ -102,6 +102,8 @@ build/pyodide.asm.js: src/main.bc src/jsimport.bc src/jsproxy.bc src/js2python.b
build/pyodide.asm.data: root/.built
python2 $(FILEPACKAGER) build/pyodide.asm.data --preload root/lib@lib --js-output=build/pyodide.asm.data.js
uglifyjs build/pyodide.asm.data.js -o build/pyodide.asm.data.js
build/pyodide_dev.js: src/pyodide.js
cp $< $@
......
......@@ -16,7 +16,10 @@ These instructions were tested on Linux. OSX should be substantively the same.
Make sure the prerequisites for [emsdk](https://github.com/juj/emsdk) are installed.
Install [lessc](https://lesscss.org/) to compile less to css.
Additional build prerequisites are:
- [lessc](https://lesscss.org/) to compile less to css.
- [uglifyjs](https://github.com/mishoo/UglifyJS) to minify Javascript builds.
Type `make`.
......
#!/bin/sh
python2 emsdk/emsdk/emscripten/tag-1.38.4/tools/file_packager.py build/$1.data --preload $2 --js-output=build/$1.js --export-name=pyodide --exclude \*.wasm.pre --exclude __pycache__
uglifyjs build/$1.js -o build/$1.js
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment