forked from simov/grant
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·31 lines (25 loc) · 800 Bytes
/
build.sh
File metadata and controls
executable file
·31 lines (25 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# Grant uses language features available in Node >= 8
# Grant is transpiled to support versions of Node >= 4
# The transpiled version, however, is used only on Node 4 and 6
# Node >= 8 uses the raw source files instead
# prepublish
rm -rf build/ && mkdir build
# alias
babel=node_modules/.bin/babel
# transpile
$babel lib/consumer --out-dir build/lib/consumer
# do not transpile
# hapi17 and koa2 depend on Node >= 8
# koa1 works natively on Node >= 4
cp lib/consumer/koa.js build/lib/consumer/
cp lib/consumer/koa2.js build/lib/consumer/
cp lib/consumer/hapi17.js build/lib/consumer/
# transpile
$babel lib/flow --out-dir build/lib/flow
$babel lib/*.js --out-dir build
$babel test --out-dir build/test
$babel *.js --out-dir build
# copy
cp -r config/ build/
cp package.json build/