Skip to content

Commit c69e24f

Browse files
authored
watch mode for build (#64)
1 parent 8e314be commit c69e24f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

bin/build.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import esbuild from 'esbuild';
22
import {readFile} from 'fs/promises';
3+
import minimist from 'minimist';
4+
5+
const argv = minimist(process.argv.slice(2));
36

47
const readJson = async (path) =>
58
JSON.parse(await readFile(new URL(path, import.meta.url)));
@@ -46,6 +49,7 @@ async function build() {
4649
platform: 'node',
4750
logLevel: 'info',
4851
plugins: [preactCompatPlugin],
52+
watch: argv.watch,
4953
external,
5054
outdir,
5155
...options,

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@
3737
"babel-loader": "8.2.3",
3838
"core-js": "3.21.0",
3939
"esbuild": "0.14.21",
40+
"minimist": "1.2.5",
4041
"react": "17.0.2"
4142
},
4243
"scripts": {
4344
"dev": "tsc --watch --preserveWatchOutput",
4445
"build": "node bin/build.mjs",
46+
"watch": "npm run build -- --watch",
4547
"test": "echo 'No tests' && exit 0",
4648
"clean": "rm -r esm dist",
4749
"prepublishOnly": "npm run build",

0 commit comments

Comments
 (0)