2024-02-16 17:18:50 +00:00
|
|
|
// For pnpm typecheck:docs to generate correct types
|
2024-02-22 13:12:00 +00:00
|
|
|
|
2024-08-26 19:57:58 +00:00
|
|
|
import { addPluginTemplate, addRouteMiddleware } from 'nuxt/kit'
|
2024-02-22 13:12:00 +00:00
|
|
|
|
2024-02-16 17:18:50 +00:00
|
|
|
export default defineNuxtConfig({
|
2024-02-22 13:12:00 +00:00
|
|
|
modules: [
|
|
|
|
function () {
|
2024-08-26 19:57:58 +00:00
|
|
|
if (!process.env.DOCS_TYPECHECK) { return }
|
2024-02-22 13:12:00 +00:00
|
|
|
addPluginTemplate({
|
|
|
|
filename: 'plugins/my-plugin.mjs',
|
2024-04-05 18:08:32 +00:00
|
|
|
getContents: () => 'export default defineNuxtPlugin({ name: \'my-plugin\' })',
|
2024-02-22 13:12:00 +00:00
|
|
|
})
|
2024-08-26 19:57:58 +00:00
|
|
|
addRouteMiddleware({
|
|
|
|
name: 'auth',
|
|
|
|
path: '#build/auth.js',
|
|
|
|
})
|
2024-04-05 18:08:32 +00:00
|
|
|
},
|
|
|
|
],
|
2024-10-16 21:52:04 +00:00
|
|
|
pages: process.env.DOCS_TYPECHECK === 'true',
|
2024-11-26 13:01:38 +00:00
|
|
|
typescript: {
|
|
|
|
shim: process.env.DOCS_TYPECHECK === 'true',
|
|
|
|
hoist: ['@vitejs/plugin-vue', 'vue-router'],
|
|
|
|
},
|
2024-02-16 17:18:50 +00:00
|
|
|
})
|