forked from scttcper/ngx-toastr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ts
37 lines (33 loc) · 945 Bytes
/
build.ts
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
import { copySync } from 'fs-extra';
import { build } from 'ng-packagr';
import { join } from 'path';
import * as rimraf from 'rimraf';
async function main() {
// cleanup dist
rimraf.sync(join(process.cwd(), '/dist'));
// build packages
await build({
project: join(process.cwd(), 'src/lib/package.json'),
});
// copy everything else
copySync('README.md', join(process.cwd(), 'dist/README.md'));
copySync('LICENSE', join(process.cwd(), 'dist/LICENSE'));
copySync(
join(process.cwd(), 'src/lib/toastr-bs4-alert.scss'),
join(process.cwd(), 'dist/toastr-bs4-alert.scss'),
);
copySync(
join(process.cwd(), 'src/lib/toastr.css'),
join(process.cwd(), 'dist/toastr.css'),
);
copySync(
join(process.cwd(), 'src/lib/toastr-old.css'),
join(process.cwd(), 'dist/toastr-old.css'),
);
}
main()
.then(() => console.log('success'))
.catch((e) => {
console.error(e);
process.exit(1);
});