forked from cebor/angular-highcharts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·44 lines (36 loc) · 1.22 KB
/
build.sh
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
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
cd "$(dirname "$0")"
# Clean up previous distributions
rm -rf dist
rm -rf build
# Binaries
NGC="node node_modules/.bin/ngc"
ROLLUP="node node_modules/.bin/rollup"
# ES6
$NGC -p src/tsconfig-build.json
$ROLLUP build/angular-highcharts.js \
--output.file dist/angular-highcharts.js \
--output.format es \
--external "@angular/core,highcharts,highcharts/highstock"
# ES5
$NGC -p src/tsconfig-es5.json
$ROLLUP build/angular-highcharts.js \
--output.file dist/angular-highcharts.es5.js \
--output.format es \
--context window \
--external "@angular/core,highcharts,highcharts/highstock"
# UMD (legacy)
$ROLLUP dist/angular-highcharts.es5.js \
--output.file dist/angular-highcharts.umd.js \
--output.format umd \
--external "@angular/core,highcharts,highcharts/highstock" \
--globals "@angular/core:ng.core,highcharts:Highcharts,highcharts/highstock:Highstock" \
--name ng.highcharts
# Copy non-js files from build
rsync -a --exclude=*.js build/ dist
# Copy library package.json and README.md
cp src/package.json dist/package.json
cp README.md dist/README.md
# Set dist/package.json version
VERSION="$(node -p "require('./package.json').version")"
cd dist && npm --no-git-tag-version version $VERSION