Skip to content
Source
Sign inSign up

set-strip-internal.mjs

11 lines363 Bytes

1import * as Fs from "node:fs"
2​
3const path = new URL("../tsconfig.base.json", import.meta.url)
4const contents = Fs.readFileSync(path, "utf8")
5const updated = contents.replace('"stripInternal": false', '"stripInternal": true')
6​
7if (contents === updated) {
8 throw new Error("Could not enable stripInternal in tsconfig.base.json")
9}
10​
11Fs.writeFileSync(path, updated)