-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathscript-build.js
42 lines (37 loc) · 1.14 KB
/
script-build.js
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
/**
* simple helper script to make builds
*/
const build = (target) => {
const checker = require('esbuild-helpers').TypeChecker({
tsConfigOverride: {
compilerOptions: {
outDir: `./dist/${target}`,
rootDir: `./src/package`,
target: 'es2018',
module: target,
lib: ['es2017', 'dom'],
emitDecoratorMetadata: true,
skipLibCheck: true,
sourceMap: true,
declaration: true,
importHelpers: true,
experimentalDecorators: true
},
exclude: ['dist', 'node_modules', 'src/sample', 'src/__tests__']
},
basePath: `./`,
name: `Building ${target}`
});
checker.printSettings();
const result = checker.inspectOnly();
checker.printOnly(result);
console.log(` -> Emitting js`);
result.oldProgram.emit();
};
async function run(){
require('esbuild-helpers').clearFolders('./dist');
['CommonJS', 'AMD', 'System', 'UMD', 'ES6', 'ES2015', 'ESNext'].forEach((target) => {
build(target);
});
}
run()