turbo
turbo copied to clipboard
Warn on not-yet-supported module usage
This implements warning on usage of unsupported modules or entire packages, on import.
~To help pinpoint the import site, it would be nice to include the complete path of the file requesting the resolve, but at this point the context is the dirname of the requesting file. I imagine this logic could be lifted up, but it seems it would need to be handled across esm, commonjs, type, etc. This centralizes it.~ Lifted it up to where the complete request origin path is available.
Test Plan:
Given the source:
import og from "@vercel/og";
import font from "@next/font";
import head from "next/head";
Turbopack warns with:
[resolve]
/path/to/testapp/src/index.jsx
Unsupported module
The module next/head is not yet supported
Unsupported module
The package @next/font is not yet supported
Unsupported module
The package @vercel/og is not yet supported
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated |
|---|---|---|---|---|
| examples-basic-web | ✅ Ready (Inspect) | Visit Preview | Oct 28, 2022 at 10:34PM (UTC) | |
| examples-designsystem-docs | ✅ Ready (Inspect) | Visit Preview | Oct 28, 2022 at 10:34PM (UTC) | |
| examples-kitchensink-blog | ✅ Ready (Inspect) | Visit Preview | Oct 28, 2022 at 10:34PM (UTC) | |
| examples-native-web | ✅ Ready (Inspect) | Visit Preview | Oct 28, 2022 at 10:34PM (UTC) | |
| examples-svelte-web | ✅ Ready (Inspect) | Visit Preview | Oct 28, 2022 at 10:34PM (UTC) | |
| turbo-site | ✅ Ready (Inspect) | Visit Preview | 💬 Add your feedback | Oct 28, 2022 at 10:34PM (UTC) |