google / google/playground-elements
Handle sourcemaps and other non-module CDN assets
- Dominant language
- TypeScript
- Stars
- 648
- Forks
- 61
- PR merge metrics
- No merged PRs in 30d
Description
Since we now serve all modules from the proxied service worker `node_modules/` directory, instead of directly from unpkg.com, sourcemaps are not available in that directory, so "Could not load content" errors can show up in the console.
It would be nice for sourcemaps to work.
However, it wouldn't be desirable to *pro-actively* fetch sourcemaps in the way we currently pro-actively fetch the entire module graph during build, since that will slow down the build unnecessarily, and are only fetched by the browser when devtools are open (and the sourcemaps option is on).
We'll probably want to add *on-demand proxying* to the service worker to support this use case. That is, if there is a request to the service worker `node_modules/` directory that isn't already satisfied by our build output, we could just directly proxy it from the CDN on-demand.
Contributor guide
Assessment
This issue has not been assessed yet.