-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.mjs
More file actions
executable file
·34 lines (29 loc) · 830 Bytes
/
build.mjs
File metadata and controls
executable file
·34 lines (29 loc) · 830 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
#!/usr/bin/env npx kubik
import path from 'path';
import esbuild from 'esbuild';
import fs from 'fs';
import { Task } from 'kubik';
const { __dirname, $ } = Task.init(import.meta, {
name: 'build & lint',
watch: [ './src', './package.json' ],
});
const outDir = path.join(__dirname, 'lib');
const srcDir = path.join(__dirname, 'src');
const typesDir = path.join(__dirname, 'types');
await fs.promises.rm(outDir, { recursive: true }).catch(e => void e);
await fs.promises.rm(typesDir, { recursive: true }).catch(e => void e);
const { errors } = await esbuild.build({
color: true,
entryPoints: [
path.join(srcDir, '**/*.ts'),
],
outdir: outDir,
format: 'esm',
platform: 'node',
target: ['node22'],
sourcemap: false,
bundle: false,
minify: false,
});
if (!errors.length)
await $`tsc --pretty -p .`;