mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 07:05:11 +00:00
b7e10e3956
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel Roe <daniel@roe.dev>
22 lines
616 B
TypeScript
22 lines
616 B
TypeScript
// For pnpm typecheck:docs to generate correct types
|
|
|
|
import { addPluginTemplate, addRouteMiddleware } from 'nuxt/kit'
|
|
|
|
export default defineNuxtConfig({
|
|
modules: [
|
|
function () {
|
|
if (!process.env.DOCS_TYPECHECK) { return }
|
|
addPluginTemplate({
|
|
filename: 'plugins/my-plugin.mjs',
|
|
getContents: () => 'export default defineNuxtPlugin({ name: \'my-plugin\' })',
|
|
})
|
|
addRouteMiddleware({
|
|
name: 'auth',
|
|
path: '#build/auth.js',
|
|
})
|
|
},
|
|
],
|
|
pages: process.env.DOCS_TYPECHECK === 'true',
|
|
typescript: { shim: process.env.DOCS_TYPECHECK === 'true' },
|
|
})
|