mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-14 01:53:55 +00:00
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({
|
|
typescript: { shim: process.env.DOCS_TYPECHECK === 'true' },
|
|
pages: process.env.DOCS_TYPECHECK === 'true',
|
|
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',
|
|
})
|
|
},
|
|
],
|
|
})
|