v1 documentation compatible with Nuxt 3. To get started, add @nuxt/image to your project:
npx nuxt module add image
Add @nuxt/image dependency to your project:
npm i @nuxt/image
yarn add @nuxt/image
pnpm add @nuxt/image
bun add @nuxt/image
Then, add it to the modules in your nuxt.config:
export default defineNuxtConfig({
  modules: [
    '@nuxt/image'
  ]
})
Add an image section in your nuxt.config:
export default defineNuxtConfig({
  image: {
    // Options
  }
})
After each commit is merged into the main branch of @nuxt/image and passing all tests, we trigger an automated npm release using GitHub Actions publishing a @nuxt/image-nightly package.
You can opt in to use this release channel and avoid waiting for the next release and helping the module by beta testing changes.
The build and publishing method and quality of edge releases are the same as stable ones. The only difference is that you should often check the GitHub repository for updates. There is a slight chance of regressions not being caught during the review process and by the automated tests. Therefore, we internally use this channel to double-check everything before each release.
Update @nuxt/image dependency inside package.json:
{
  "devDependencies": {
-   "@nuxt/image": "^1.0.0"
+   "@nuxt/image": "npm:@nuxt/image-nightly@latest"
  }
}
Remove lockfile (package-lock.json, yarn.lock, or pnpm-lock.yaml) and reinstall dependencies.
Update @nuxt/image dependency inside package.json:
{
  "devDependencies": {
-   "@nuxt/image": "npm:@nuxt/image-nightly@latest"
+   "@nuxt/image": "^1.0.0"
  }
}
Remove lockfile (package-lock.json, yarn.lock, or pnpm-lock.yaml) and reinstall dependencies.
If an error occurs during installation:
npm up @nuxt/image
yarn upgrade @nuxt/image
pnpm up @nuxt/image
bun update @nuxt/image
npx nuxt upgrade --force
sharp and node-gyp, it is probably because your OS architecture or NodeJS version is not included in pre-built binaries and needs to be built from source (for example, this sometimes occurs on Apple M1). Checkout node-gyp for install requirements.