Guides

Checking Links on Build

Last updated by
Harlan Wilton
in doc: unify content.

Introduction

By default, links will be scanned when you run your build.

Throwing Build Errors

When building and deploying your app in a CI, you may like to disable the deployment if there are any broken links.

To do so you can enable the failOnError option. This will exit the process with a non-zero exit code.

export default defineNuxtConfig({
  linkChecker: {
    failOnError: true,
  },
})

Generating Reports

Check the Generate Reports guide for more details.

Disabling Build Scans

If you want to disable build link scanning, you can set runOnBuild to false in your nuxt.config:

export default defineNuxtConfig({
  linkChecker: {
    runOnBuild: false,
  },
})
Did this page help you?