Skip to content

Commit 28de332

Browse files
codebender828pi0
authored andcommitted
chore: update snapshots
1 parent da7d46f commit 28de332

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

src/module.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath } from "url";
22
import {
33
defineNuxtModule,
44
addPlugin,
55
createResolver,
6-
addServerPlugin
7-
} from '@nuxt/kit'
6+
addServerPlugin,
7+
} from "@nuxt/kit";
88

99
declare global {
1010
interface Window {
@@ -15,31 +15,31 @@ declare global {
1515

1616
export default defineNuxtModule({
1717
meta: {
18-
name: '@nuxtjs/emotion',
19-
configKey: 'emotion',
20-
compatibilty: '>=3.0.0'
18+
name: "@nuxtjs/emotion",
19+
configKey: "emotion",
20+
compatibilty: ">=3.0.0",
2121
},
22-
setup (options, nuxt) {
22+
setup(_, nuxt) {
2323
// ensure `nitro.plugins` is initialized
24-
nuxt.options.nitro.plugins = nuxt.options.nitro.plugins || []
24+
nuxt.options.nitro.plugins = nuxt.options.nitro.plugins || [];
2525

26-
nuxt.hook('nitro:config', (config) => {
26+
nuxt.hook("nitro:config", (config) => {
2727
// Prevent inlining emotion (+ the crucial css cache!) in dev mode
2828
if (nuxt.options.dev) {
2929
if (config.externals) {
30-
config.externals.external ||= []
31-
config.externals.external.push('@emotion/server')
30+
config.externals.external ||= [];
31+
config.externals.external.push("@emotion/server");
3232
}
3333
}
34-
})
34+
});
3535

3636
/**
3737
* Register emotion plugin
3838
*/
39-
const { resolve } = createResolver(import.meta.url)
40-
const runtimeDir = fileURLToPath(new URL('./runtime', import.meta.url))
41-
nuxt.options.build.transpile.push(runtimeDir)
42-
addServerPlugin(resolve(runtimeDir, 'emotion.server'))
43-
addPlugin(resolve(runtimeDir, 'emotion.client'))
44-
}
45-
})
39+
const { resolve } = createResolver(import.meta.url);
40+
const runtimeDir = fileURLToPath(new URL("./runtime", import.meta.url));
41+
nuxt.options.build.transpile.push(runtimeDir);
42+
addServerPlugin(resolve(runtimeDir, "emotion.server"));
43+
addPlugin(resolve(runtimeDir, "emotion.client"));
44+
},
45+
});

test/__snapshots__/basic.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ exports[`nust emotion ssr > renders the index page 1`] = `
44
"<!DOCTYPE html>
55
<html >
66
<head><meta charset=\\"utf-8\\">
7-
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1\\"><link rel=\\"modulepreload\\" as=\\"script\\" crossorigin href=\\"/_nuxt/entry.3caf574f.js\\"><link rel=\\"prefetch\\" as=\\"script\\" crossorigin href=\\"/_nuxt/error-component.7dfd5ca3.js\\"><style data-emotion=\\"camw5v 1xum0ri\\">.css-camw5v{padding-inline:16px;padding-block:12px;font-size:1rem;font-family:system ui;color:white;border-radius:20px;background-color:indigo;}.css-1xum0ri{padding:13px 18px;position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;white-space:pre;border-radius:9999px;border-width:2px;border-color:transparent;background-color:rgb(245 245 240);font-size:15px;font-weight:400;line-height:21px;letter-spacing:.011em;cursor:pointer;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;}.css-1xum0ri:hover{background-color:rgb(79 77 77);color:rgb(245 245 240);}</style><script data-emotion=\\"camw5v 1xum0ri\\">window.$emotionIds=[\\"camw5v\\",\\"1xum0ri\\"]</script></head>
8-
<body ><div id=\\"__nuxt\\"><!--[--><div class=\\"css-camw5v\\">Nuxt module playground!</div><button class=\\"css-1xum0ri\\">Hello World</button><!--]--></div><script>window.__NUXT__={data:{},state:{},_errors:{},serverRendered:true,config:{public:{},app:{baseURL:\\"\\\\u002F\\",buildAssetsDir:\\"\\\\u002F_nuxt\\\\u002F\\",cdnURL:\\"\\"}}}</script><script type=\\"module\\" src=\\"/_nuxt/entry.3caf574f.js\\" crossorigin></script></body>
7+
<meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1\\"><link rel=\\"modulepreload\\" as=\\"script\\" crossorigin href=\\"/_nuxt/entry.52d2c064.js\\"><link rel=\\"prefetch\\" as=\\"script\\" crossorigin href=\\"/_nuxt/error-component.46dc171f.js\\"><style data-emotion=\\"\\"></style><script data-emotion=\\"\\">window.$emotionIds=[]</script></head>
8+
<body ><div id=\\"__nuxt\\"><div><div class=\\"css-camw5v\\"> Nuxt module playground! </div><button class=\\"css-u6jiew\\"> Hello World </button></div></div><script>window.__NUXT__={data:{},state:{},_errors:{},serverRendered:true,config:{public:{},app:{baseURL:\\"\\\\u002F\\",buildAssetsDir:\\"\\\\u002F_nuxt\\\\u002F\\",cdnURL:\\"\\"}}}</script><script type=\\"module\\" src=\\"/_nuxt/entry.52d2c064.js\\" crossorigin></script></body>
99
</html>"
1010
`;

0 commit comments

Comments
 (0)