Skip to content

Commit

Permalink
fix(vercel): remove dependency of fs-extra
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jul 12, 2022
1 parent adcba63 commit 23076b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"@nuxt/kit": "^3.0.0-rc.4",
"consola": "^2.15.3",
"defu": "^6.0.0",
"fs-extra": "^10.1.0",
"h3": "^0.7.10",
"image-meta": "^0.1.1",
"node-fetch-native": "^0.1.4",
Expand Down
8 changes: 4 additions & 4 deletions src/provider.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { promises as fsp } from 'fs'
import { normalize, resolve, dirname } from 'pathe'
import { createResolver, resolvePath } from '@nuxt/kit'
import * as fse from 'fs-extra'
import { hash } from 'ohash'
import type { InputProvider, ImageModuleProvider, ProviderSetup } from './types'
import type { ModuleOptions } from './module'
Expand Down Expand Up @@ -37,11 +37,11 @@ export const providerSetup: Record<string, ProviderSetup> = {
// https://vercel.com/docs/more/adding-your-framework#images
async vercel (_providerOptions, moduleOptions, nuxt) {
const imagesConfig = resolve(nuxt.options.rootDir, '.vercel_build_output/config/images.json')
await fse.mkdirp(dirname(imagesConfig))
await fse.writeJson(imagesConfig, {
await fsp.mkdir(dirname(imagesConfig), { recursive: true })
await fsp.writeFile(imagesConfig, JSON.stringify({
domains: moduleOptions.domains,
sizes: Array.from(new Set(Object.values(moduleOptions.screens || {})))
})
}, null, 2))
}
}

Expand Down

1 comment on commit 23076b8

@vercel
Copy link

@vercel vercel bot commented on 23076b8 Jul 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

image – ./

image-git-v1-nuxt-js.vercel.app
image-eight.vercel.app
image-nuxt-js.vercel.app

Please sign in to comment.