]> git.proxmox.com Git - mirror_xterm.js.git/blob - bin/build
2def2c2b7d785a19fbbc6f7c3c0a5eea64b8ad90
[mirror_xterm.js.git] / bin / build
1 #! /usr/bin/env bash
2
3 set -e
4
5 # $BUILD_DIR should default to "build"
6 BUILD_DIR=${BUILD_DIR:=build}
7
8 # Create the build directory
9 mkdir -p $BUILD_DIR
10
11
12 # Clean out/* to prevent confusion if files were deleted in src/
13 rm -rf out/*
14
15 # Build all TypeScript files (including tests) to out/
16 tsc
17
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
23
24 # Resolve the chain of sourcemaps so that ./$BUILD_DIR/xterm.js.map points at ./src
25 sorcery -i $BUILD_DIR/xterm.js
26
27 # Copy all CSS files from src/ to $BUILD_DIR/
28 cd src
29 find . -name '*.css' | cpio -pdm ../$BUILD_DIR
30 cd ..
31
32 # Copy addons from out/ to $BUILD_DIR/
33 cd out/addons
34 find . -name '*.js' | cpio -pdm ../../$BUILD_DIR/addons
35 cd ../..