-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.ts
73 lines (73 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
72
73
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
app: {
pageTransition: { name: "page", mode: "out-in" },
},
modules: [
"@nuxtjs/tailwindcss",
"@nuxtjs/google-fonts",
"nuxt-icon",
"@nuxt/image",
"nuxt-simple-sitemap",
"nuxt-simple-robots",
],
googleFonts: {
families: {
Inter: {
wght: [400, 700],
},
Alexandria: {
wght: 700,
},
},
},
image: {
screens: {
xs: 300,
sm: 600,
md: 600,
lg: 1000,
xl: 2000,
xxl: 2000,
"2xl": 2000,
},
providers: {
ghost: {
provider: "~/providers/ghost",
},
},
},
routeRules: {
// homepage re-validate every 10 minutes
"/": { prerender: true, isr: 600 },
// archive-related pages re-validate every 30 minutes
"/archives/**": { isr: 1800 },
"/author/**": { isr: 1800 },
"/tags/**": { isr: 1800 },
// post re-validate every 1 hour
"/posts/**": { isr: 3600 },
// add cors headers on API routes, and cache for 30 mins
"/api/**": { isr: 1800, cors: true },
},
runtimeConfig: {
ghost_url: process.env.GHOST_URL,
ghost_content_key: process.env.GHOST_CONTENT_KEY,
public: {
siteUrl: process.env.NUXT_PUBLIC_SITE_URL,
umamiUrl: process.env.UMAMI_URL,
umamiSiteId: process.env.UMAMI_SITE_ID,
},
},
// TODO: remove this in the future after Netlify done fixing.
// ref: https://answers.netlify.com/t/javascript-heap-out-of-memory-when-trying-to-build-a-nuxt-app/93138/13
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
cssnano:
process.env.NODE_ENV === "production"
? { preset: ["default", { discardComments: { removeAll: true } }] }
: false, // disable cssnano when not in production
},
},
});