mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-07 20:39:31 +08:00
The baseUrl option is used to resolve non-relative module imports. However, since we enforce that all imports are relative in DevTools, we don't actually need this option to compile succesfully. In fact, setting this option will actually break things. One instance is that packages that are written expecting Node module resolution (for instance Puppeteer or the Node types themselves), assume that they are being resolved relative to their own location (according to the Node module resolution). However, by setting `baseUrl`, we essentially remap all non-relative module imports to be resolved from the output directory. As such, if you include a file in your `ts_library` that has a name that is equivalent to a non-relative module import name in a different part, a second compilation of the `ts_library` target breaks. That's because, instead of resolving to the correct location, it now starts using the `.d.ts` file from its own `ts_library` target. By removing the `baseUrl` option, we ensure that we always resolve from source, rather than build output. This avoids the accidental usage of `.d.ts` output files and circumvents the second compilation problem. R=alexrudenko@chromium.org Bug: none Change-Id: I01b2a27fa91e42627a8ca65c8ea2f4da87af2805 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3021227 Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> Commit-Queue: Alex Rudenko <alexrudenko@chromium.org> Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>