-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.js
More file actions
29 lines (25 loc) · 755 Bytes
/
build.js
File metadata and controls
29 lines (25 loc) · 755 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
import fs from 'fs';
import { getFilesSync } from 'files-folder'
import esbuild from 'esbuild'
console.log('build');
console.log('removing previous build.');
fs.rmSync('dist', { recursive: true, force: true });
const files1 = getFilesSync('src', { filter: /\.js$/ });
const files2 = getFilesSync('src', { filter: /\.ts$/ });
const filesAll = [...files1, ...files2];
console.log('including *.js, *.ts, .....');
console.log(filesAll);
esbuild
.build({
entryPoints: filesAll,
bundle: false,
minify: false,
sourcemap: true, // helpful for debugging
target: ['node18'],
platform: 'node',
allowOverwrite: true,
outdir: 'dist'
})
.catch((error) => {
process.exit(1)
})