-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.js
More file actions
44 lines (37 loc) · 838 Bytes
/
build.js
File metadata and controls
44 lines (37 loc) · 838 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
32
33
34
35
36
37
38
39
40
41
const { replaceInFileSync } = require("replace-in-file");
const { execSync } = require('child_process');
function callScript(cmd) {
try {
execSync(cmd).toString();
} catch (e) {
//console.error(e);
}
}
function replaceFileData(configs) {
let results = [];
for (const config of configs) {
try {
console.log(replaceInFileSync(config));
} catch (e) {
console.error(e);
}
}
}
callScript('api-extractor run');
replaceFileData([
{
files: './dist/mcbe-types.d.ts',
from: /export { }/g,
to: ''
},
{
files: './dist/mcbe-types.d.ts',
from: /(\bexport \b)/g,
to: ''
},
{
files: './dist/mcbe-types.d.ts',
from: /(declare\sinterface)/g,
to: 'interface'
}
]);