-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ps1
40 lines (29 loc) · 1.03 KB
/
build.ps1
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
# Clean up previous distributions if folders exist
if (Test-Path dist) {
Remove-Item dist -Recurse -Force
}
if (Test-Path build) {
Remove-Item build -Recurse -Force
}
if (Test-Path .tmp) {
Remove-Item .tmp -Recurse -Force
}
& gulp js:build
Copy-Item -Path src/tsconfig-build.json -Destination .tmp/tsconfig-build.json
Copy-Item -Path src/tsconfig-es5.json -Destination .tmp/tsconfig-es5.json
# Variables
$NGC="node_modules/.bin/ngc.cmd"
$ROLLUP="node_modules/.bin/rollup.cmd"
# Run Angular Compiler
& "$NGC" -p .tmp/tsconfig-build.json
# Rollup angular-datepickr.js
& "$ROLLUP" build/angular-datepickr.js -o dist/angular-datepickr.js
# Run Angular Compiler to ES5
& "$NGC" -p .tmp/tsconfig-es5.json
# Rollup angular-datepickr.js
& "$ROLLUP" build/angular-datepickr.js -o dist/angular-datepickr.es5.js
# Copy non-js files from build
Copy-Item -Exclude *.js -Recurse -Path build/* -Destination dist
# Copy library package.json
Copy-Item -Path src/package.json -Destination dist/package.json
Copy-Item -Path README.md -Destination dist/README.md