Skip to content

Commit

Permalink
fix: rename config
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Dec 16, 2022
1 parent 56212bb commit dfa3fd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions README.md
Expand Up @@ -34,7 +34,7 @@ Generate dynamic social share images for you Nuxt v3 app.
- 📸 OR just generate screenshots
- 📦 Choose your API: Composition or components

⚠️ SSR runtime rendering is experimental.
🔨 Edge rendering is coming soon!

## Install

Expand Down Expand Up @@ -97,8 +97,7 @@ export default defineNuxtConfig({

### Pre-render routes

While the module is in early access, you should ensure that you pre-render any pages you want to
generate images for.
While the module is in early access, only pre-rendered routes are supported.

```ts
export default defineNuxtConfig({
Expand Down Expand Up @@ -250,7 +249,7 @@ the following URLs:

The host of your site. This is required to generate the absolute path of the og:image.

### `runtimeImages`
### `serverSideRender`

- Type: `boolean`
- Default: `process.dev`
Expand Down
6 changes: 3 additions & 3 deletions src/module.ts
Expand Up @@ -35,7 +35,7 @@ export interface ModuleOptions extends ScreenshotOptions {
/**
* Are we edge-side rendering images.
*/
edgeSideRender: boolean
serverSideRender: boolean
}

export default defineNuxtModule<ModuleOptions>({
Expand All @@ -54,7 +54,7 @@ export default defineNuxtModule<ModuleOptions>({
height: 630,
defaultIslandComponent: 'OgImageTemplate',
outputDir: '_og-images',
edgeSideRender: nuxt.options.dev || (process.env.NITRO_PRESET || '').includes('edge'),
serverSideRender: nuxt.options.dev || (process.env.NITRO_PRESET || '').includes('edge'),
}
},
async setup(config, nuxt) {
Expand Down Expand Up @@ -89,7 +89,7 @@ declare module 'nitropack' {
addServerHandler({
handler: resolve('./runtime/nitro/html'),
})
if (config.edgeSideRender) {
if (config.serverSideRender) {
addServerHandler({
handler: resolve('./runtime/nitro/image'),
})
Expand Down

0 comments on commit dfa3fd5

Please sign in to comment.