-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathnuxt.config.ts
71 lines (67 loc) · 1.83 KB
/
nuxt.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import { defineEventHandler } from 'h3'
import { defineNuxtConfig } from '@nuxt/bridge'
// @ts-ignore
global.__NUXT_PREPATHS__ = (global.__NUXT_PREPATHS__ || []).concat(__dirname)
const bridgeConfig = {
vite: process.env.TEST_BUILDER !== 'webpack' ? { legacy: process.env.TEST_VITE_LEGACY !== 'no-legacy' } : false,
transpile: process.env.TEST_TRANSPILE !== 'no-transpile',
compatibility: process.env.TEST_COMPATIBILITY !== 'no-compatibility',
typescript: {
isTSX: !process.env.TEST_TYPESCRIPT || process.env.TEST_TYPESCRIPT === 'isTSX',
esbuild: process.env.TEST_TYPESCRIPT === 'esbuild'
},
// Not yet tested in matrix
nitro: process.env.TEST_NITRO !== 'false',
nitroGenerator: process.env.TEST_NITRO_GENERATOR !== 'false',
imports: process.env.TEST_IMPORTS !== 'false',
meta: process.env.TEST_META !== 'false',
macros: {
pageMeta: true
}
}
console.log('Bridge config:', bridgeConfig)
export default defineNuxtConfig({
app: {
head: {
meta: [
{ name: 'viewport', content: 'width=1024, initial-scale=1' },
{ charset: 'utf-8' },
{ name: 'description', content: 'Nuxt Fixture' }
]
}
},
components: true,
serverMiddleware: [
{
handle: defineEventHandler((event) => {
event.node.req.spa = event.node.req.url.includes('?spa')
})
}
],
modules: [
function () {
this.nuxt.options.plugins.unshift({
src: '~/plugins/config'
})
}
],
plugins: ['~/plugins/setup.js', '~/plugins/store.js', '~/plugins/cookie'],
nitro: {
routeRules: {
'/route-rules/spa': { ssr: false }
},
plugins: ['plugins/template.ts']
},
bridge: bridgeConfig,
vite: {
build: {
assetsInlineLimit: 100 // keep SVG as assets URL
}
},
runtimeConfig: {
secretKey: 'nuxt',
public: {
myValue: 123
}
}
})