]>
Commit | Line | Data |
---|---|---|
56ecc77d | 1 | #! /usr/bin/env bash |
ed1a31d1 | 2 | |
6cc66a0b PK |
3 | set -e |
4 | ||
5 | # $BUILD_DIR should default to "build" | |
70ec2496 | 6 | BUILD_DIR=${BUILD_DIR:=build} |
6cc66a0b | 7 | |
243d7661 PK |
8 | # Create the build directory |
9 | mkdir -p $BUILD_DIR | |
10 | ||
11 | ||
83b06c6b DI |
12 | # Clean out/* to prevent confusion if files were deleted in src/ |
13 | rm -rf out/* | |
14 | ||
56ecc77d DI |
15 | # Build all TypeScript files (including tests) to out/ |
16 | tsc | |
17 | ||
6cc66a0b PK |
18 | # Concat all xterm.js files into a single file and output as a UMD to $BUILD_DIR/xterm.js |
19 | browserify ./out/xterm.js --standalone Terminal --debug --outfile ./$BUILD_DIR/xterm.js | |
20 | cat ./$BUILD_DIR/xterm.js | exorcist ./$BUILD_DIR/xterm.js.map -b ./$BUILD_DIR > ./$BUILD_DIR/xterm.temp.js | |
21 | rm ./$BUILD_DIR/xterm.js | |
22 | mv ./$BUILD_DIR/xterm.temp.js ./$BUILD_DIR/xterm.js | |
c63732ef | 23 | |
6cc66a0b PK |
24 | # Resolve the chain of sourcemaps so that ./$BUILD_DIR/xterm.js.map points at ./src |
25 | sorcery -i $BUILD_DIR/xterm.js | |
56ecc77d | 26 | |
6cc66a0b | 27 | # Copy all CSS files from src/ to $BUILD_DIR/ |
56ecc77d | 28 | cd src |
6cc66a0b | 29 | find . -name '*.css' | cpio -pdm ../$BUILD_DIR |
56ecc77d DI |
30 | cd .. |
31 | ||
6cc66a0b | 32 | # Copy addons from out/ to $BUILD_DIR/ |
56ecc77d | 33 | cd out/addons |
6cc66a0b | 34 | find . -name '*.js' | cpio -pdm ../../$BUILD_DIR/addons |
56ecc77d | 35 | cd ../.. |