forked from scttcper/ngx-emoji-mart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ts
55 lines (48 loc) · 1.39 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { copySync } from 'fs-extra';
import { ngPackagr } from 'ng-packagr';
import { join } from 'path';
import * as rimraf from 'rimraf';
async function main() {
// cleanup dist
rimraf.sync(join(process.cwd(), '/dist'));
rimraf.sync(join(process.cwd(), '/node_modules/@ctrl/ngx-emoji-mart'));
// make emoi
await ngPackagr()
.forProject(join(process.cwd(), 'src/lib/emoji/package.json'))
.build();
// put it in node modules so the path resolves
// proper path support eventually
copySync(
join(process.cwd(), '/dist/emoji'),
join(process.cwd(), '/node_modules/@ctrl/ngx-emoji-mart/ngx-emoji'),
);
copySync(
join(process.cwd(), '/dist/emoji'),
join(process.cwd(), '/dist/packages-dist/ngx-emoji'),
);
await ngPackagr()
.forProject(join(process.cwd(), 'src/lib/picker/package.json'))
.build();
copySync(
join(process.cwd(), '/dist/picker'),
join(process.cwd(), '/dist/packages-dist'),
);
copySync(
join(process.cwd(), 'README.md'),
join(process.cwd(), 'dist/packages-dist/README.md'),
);
copySync(
join(process.cwd(), 'LICENSE'),
join(process.cwd(), 'dist/packages-dist/LICENSE'),
);
copySync(
join(process.cwd(), 'src/lib/picker/picker.css'),
join(process.cwd(), 'dist/packages-dist/picker.css'),
);
}
main()
.then(() => console.log('success'))
.catch(e => {
console.error(e);
process.exit(1);
});