Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed May 12, 2022
1 parent 89c0d9d commit 3eacfe2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -553,11 +553,15 @@ An event handler for turning that into a `<link>` is automatically registered wh
//@import url("http://localhost:3000/styles/globals.css");
```
Additionally, bun exposes an API for SSR/SSG that returns a flat list of URLs to css files imported. That function is `bun.getImportedStyles()`.
Additionally, bun exposes an API for SSR/SSG that returns a flat list of URLs to css files imported. That function is `Bun.getImportedStyles()`.
```ts
// This specifically is for "framework" in package.json when loaded via `bun dev`
// This API needs to be changed somewhat to work more generally with Bun.js
// Initially, you could only use bun.js through `bun dev`
// and this API was created at that time
addEventListener("fetch", async (event: FetchEvent) => {
var route = bun.match(event);
var route = Bun.match(event);
const App = await import("pages/_app");

// This returns all .css files that were imported in the line above.
Expand Down

0 comments on commit 3eacfe2

Please sign in to comment.