Compare commits

...

2 commits

Author SHA1 Message Date
f293cbd05f Add some output 2024-08-17 06:24:10 -04:00
96b093fcf5 Fix hardcoded paths 2024-08-17 06:23:02 -04:00
2 changed files with 4 additions and 4 deletions

BIN
bun.lockb

Binary file not shown.

View file

@ -98,22 +98,22 @@ function mergeSourcemaps(sourcemaps: RojoSourcemap[]): RojoSourcemap {
} }
async function rebuild() { async function rebuild() {
const sourcemaps = await Promise.all([ const sourcemaps = await Promise.all(SOURCE_ROOTS.map(getPrefixedSourcemap))
getPrefixedSourcemap('Secret'),
getPrefixedSourcemap('Core'),
])
const sourcemap = mergeSourcemaps(sourcemaps) const sourcemap = mergeSourcemaps(sourcemaps)
await fs.promises.writeFile( await fs.promises.writeFile(
'sourcemap.json', 'sourcemap.json',
JSON.stringify(sourcemap, null, 2), JSON.stringify(sourcemap, null, 2),
) )
console.log('Sourcemap rebuilt.')
} }
for (const root of SOURCE_ROOTS) { for (const root of SOURCE_ROOTS) {
fs.watch(root, { recursive: true }, () => { fs.watch(root, { recursive: true }, () => {
console.log(`Detected change in ${root}, rebuilding sourcemap...`)
sourcemapCache.delete(root) sourcemapCache.delete(root)
rebuild() rebuild()
}) })
} }
console.log('Rebuilding sourcemap...')
rebuild() rebuild()