Compare commits
2 commits
be07bb510f
...
f293cbd05f
Author | SHA1 | Date | |
---|---|---|---|
f293cbd05f | |||
96b093fcf5 |
2 changed files with 4 additions and 4 deletions
BIN
bun.lockb
BIN
bun.lockb
Binary file not shown.
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue