forked from weaviate/typescript-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
executable file
·32 lines (31 loc) · 831 Bytes
/
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
#!/usr/bin/env node
const esbuild = require('esbuild');
// https://esbuild.github.io/api/
esbuild
.build({
bundle: true,
entryPoints: ['./src/index.ts'],
external: ['@babel/runtime', 'isomorphic-fetch', 'graphql-request'],
format: 'cjs',
logLevel: 'info',
metafile: true,
minify: true,
outfile: 'dist/index.js',
platform: 'node',
sourcemap: true,
target: 'es2020',
})
.then((result) => {
return esbuild.analyzeMetafile(result.metafile);
})
.then((analyzeResult) => {
console.log('------------------------------');
console.log('Build analysis');
console.log('------------------------------');
console.log(analyzeResult);
})
.catch((e) => {
console.error('Build error!', e);
// eslint-disable-next-line no-process-exit
process.exit(1);
});