File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change 1
- import { extractCritical } from ' @emotion/server'
2
- import { NitroApp } from ' nitropack'
1
+ import { extractCritical } from " @emotion/server" ;
2
+ import { NitroApp } from " nitropack" ;
3
3
4
4
/**
5
5
* Why are we declaring types for `defineNitroPlugin`?
@@ -20,18 +20,18 @@ export interface NitroAppPlugin {
20
20
( nitro : NitroApp ) : void ;
21
21
}
22
22
23
- export function defineNitroPlugin ( def : NitroAppPlugin ) : NitroAppPlugin {
24
- return def
23
+ export function defineNitroPlugin ( def : NitroAppPlugin ) : NitroAppPlugin {
24
+ return def ;
25
25
}
26
26
27
27
export default defineNitroPlugin ( ( nitroApp ) => {
28
- nitroApp . hooks . hook ( ' render:html' , ( html ) => {
29
- const { ids, css } = extractCritical ( html . body )
30
- html . head . push ( `<style data-emotion="${ ids . join ( ' ' ) } ">${ css } </style>` )
28
+ nitroApp . hooks . hook ( " render:html" , ( html ) => {
29
+ const { ids, css } = extractCritical ( html . body ) ;
30
+ html . head . push ( `<style data-emotion="${ ids . join ( " " ) } ">${ css } </style>` ) ;
31
31
html . head . push (
32
32
`<script data-emotion="${ ids . join (
33
- ' '
34
- ) } ">window.$emotionIds =${ JSON . stringify ( ids ) } </script>`
35
- )
36
- } )
37
- } )
33
+ " "
34
+ ) } ">window.$emotionSSRIds =${ JSON . stringify ( ids ) } </script>`
35
+ ) ;
36
+ } ) ;
37
+ } ) ;
You can’t perform that action at this time.
0 commit comments