Nuxt/test/fixtures/bridge/nuxt.config.ts
Anthony Fu 46f858dd82
chore: move nuxt-vite to bridge (#1180)
Co-authored-by: Xin Du (Clark) <clark.duxin@gmail.com>
Co-authored-by: pooya parsa <pyapar@gmail.com>
2021-10-26 14:59:05 +02:00

27 lines
618 B
TypeScript

import { defineNuxtConfig } from '@nuxt/bridge'
// @ts-ignore
global.__NUXT_PREPATHS__ = (global.__NUXT_PREPATHS__ || []).concat(__dirname)
export default defineNuxtConfig({
components: true,
serverMiddleware: [
{
handle (req, _res, next) {
req.spa = req.url.includes('?spa')
next()
}
}
],
buildDir: process.env.NITRO_BUILD_DIR,
plugins: ['~/plugins/setup.js'],
nitro: {
output: { dir: process.env.NITRO_OUTPUT_DIR }
},
bridge: {
meta: true,
vite: !!process.env.TEST_BRIDGE_VITE
},
vite: process.env.TEST_BRIDGE_VITE ? { build: {} } : undefined
})