diff --git a/nuxt.config.ts b/nuxt.config.ts index 4e4d99b93..38b243d30 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -1,5 +1,4 @@ import { useNuxt } from 'nuxt/kit' -import type { InputPluginOption } from 'rollup' export default defineNuxtConfig({ $production: { @@ -57,24 +56,6 @@ export default defineNuxtConfig({ config.prerender ||= {} config.prerender.crawlLinks = false } - ;(config.rollupConfig!.plugins as InputPluginOption[]).push({ - name: 'purge-the-handler', - transform(_code, id) { - if (id.includes('og/[slug]') || id.includes('thumbnail/[slug]')) { - return 'export default defineEventHandler(() => {})' - } - }, - }) - }, - 'nitro:init'(nitro) { - nitro.options._config.rollupConfig!.plugins = ( - nitro.options._config.rollupConfig!.plugins as InputPluginOption[] - ).filter(p => !p || !('name' in p) || p.name !== 'purge-the-handler') - }, - 'vite:extendConfig'(config, { isClient }) { - if (isClient) { - config.define!['process.env.prerender'] = 'false' - } }, }, diff --git a/src/app.vue b/src/app.vue index ab482b378..ab474abab 100644 --- a/src/app.vue +++ b/src/app.vue @@ -31,7 +31,7 @@ useHead({ }, }) -if (process.server) { +if (import.meta.server) { const PATH_RE = createRegExp( exactly(char.times.any().and(charNotIn('/'))) .as('path') diff --git a/src/components/StaticMarkdownRender.server.ts b/src/components/StaticMarkdownRender.server.ts index 7cb8e728e..eb6b52a8b 100644 --- a/src/components/StaticMarkdownRender.server.ts +++ b/src/components/StaticMarkdownRender.server.ts @@ -6,7 +6,7 @@ export default defineComponent({ path: String, }, async setup(props) { - if (process.dev) { + if (import.meta.dev) { const { data } = await useAsyncData(() => queryContent(props.path!).findOne() ) diff --git a/src/components/TheGithubRepos.server.vue b/src/components/TheGithubRepos.server.vue index a2e3638ae..1201c2ea1 100644 --- a/src/components/TheGithubRepos.server.vue +++ b/src/components/TheGithubRepos.server.vue @@ -40,7 +40,7 @@