Files
xterm.js/bin/build
T
Daniel Imms 83b06c6bb0 Clean out/* on build in case src/* files were deleted
If files in src/ were compiled and then deleted they will hang around in out/
until deleted. This can potentially cause difficult to diagnose build/test
errors. This commit removes all files from out/ but keeps the folder to
prevent editor file watchers from seeing the folder was deleted and shifting
the file explorer around.

Fixed #381
2016-11-28 10:52:03 -08:00

27 lines
776 B
Python
Executable File

#! /usr/bin/env bash
# Clean out/* to prevent confusion if files were deleted in src/
rm -rf out/*
# Build all TypeScript files (including tests) to out/
tsc
# Concat all xterm.js files into a single file and output as a UMD to dist/xterm.js
browserify ./out/xterm.js --standalone Terminal --debug --outfile ./dist/xterm.js
cat ./dist/xterm.js | exorcist ./dist/xterm.js.map -b ./dist > ./dist/xterm.temp.js
rm ./dist/xterm.js
mv ./dist/xterm.temp.js ./dist/xterm.js
# Resolve the chain of sourcemaps so that ./dist/xterm.js.map points at ./src
sorcery -i dist/xterm.js
# Copy all CSS files from src/ to dist/
cd src
find . -name '*.css' | cpio -pdm ../dist
cd ..
# Copy addons from out/ to dist/
cd out/addons
find . -name '*.js' | cpio -pdm ../../dist/addons
cd ../..