Improve bundle size by replacing detective-typescript (#10825)

* replace `detective-typescript` with our own implementation

We are not parsing the code but just trying to pluck out the
dependencies used via `import` and `require`.

* drop `detective-typescript`

* return a `Set` instead of an `Array`

* resolve rebuilds, but log errors in case they occur

This won't be the prettiest if it happens, but at least we are not
swallowing errors which should make bugs be easier to discover.

See previous commit for an example... 😅

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
This commit is contained in:
Robin Malfait 2023-03-20 18:30:47 +01:00 • committed by GitHub
parent 6a2c58acf8
commit e046a37dbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 278 additions and 837 deletions

View file

@ -89,7 +89,9 @@ export function createWatcher(args, { state, rebuild }) {
// Resolve the promise even when the rebuild fails
return rebuild(changes).then(
() => {},
() => {}
(e) => {
console.error(e.toString())
}
)
}