Checking Links on Build
See your link checker results when you build.
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
export default defineNuxtConfig({
linkChecker: {
failOnError: true,
},
})
Generating Reports
To make working in a CI environment easier, you are able to generate a static report of the broken links.
There are two reports available:
To generate them, you can provide the
export default defineNuxtConfig({
linkChecker: {
report: {
// generate both a html and markdown report
html: true,
markdown: true,
}
},
})
The reports will be output in the following paths:
html :./output/link-checker-report.html markdown :./output/link-checker-report.md
Disabling Build Scans
If you want to disable build link scanning, you can set
export default defineNuxtConfig({
linkChecker: {
runOnBuild: false,
},
})
Did this page help you?