#Watch all `.ts` files, run just one?
1 messages · Page 1 of 1 (latest)
you can watch bun build with --watch and you --watch on normal run refreshes the app on any change to imported file
these files are completely separate and none imports into another
here is what I am currently doing to make --watch work
import * as tstl from 'typescript-to-lua'
import './src/mcm'
const scriptsDir = process.cwd() + '/gamedata/scripts/'
export function transpile() {
tstl.transpileFiles(['./src/mcm.ts'], { extension: '.script', outDir: scriptsDir })
}
index.ts (bun run --watch index.ts)
import { transpile } from './ts-to-lua'
transpile()
the mcm.ts is what I need to trigger the reload upon changing
and it somehow works
you should be able to use the node watch api then right?
node watch api?