-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.ts
81 lines (79 loc) · 1.88 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
74
75
76
77
78
79
80
81
import { resolve } from 'node:path'
import { icons } from './icons.json'
const MAX_AGE = 31536000
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
app: {
head: {
title: 'Countries Rest API Demo',
htmlAttrs: {
lang: 'en',
dir: 'ltr',
},
link: [
{
rel: 'icon',
type: 'image/png',
href: '/favicon.png',
},
],
},
},
nitro: {
routeRules: {
'https://flagcdn.com/**': { headers: { 'cache-control': `public,max-age=${MAX_AGE},s-maxage=${MAX_AGE}` } },
'/fonts/**': { headers: { 'cache-control': `public,max-age=${MAX_AGE},s-maxage=${MAX_AGE}` } },
},
},
devtools: {
enabled: true,
timeline: {
enabled: true,
},
},
experimental: { typedPages: true },
modules: [
'@nuxtjs/color-mode',
'@vueuse/nuxt',
'nuxt-simple-robots',
'@vite-pwa/nuxt',
'nuxt-icon',
],
css: [
'@/assets/styles/bootstrap-grid.min.css',
'@/assets/styles/fontStyle.scss',
'@/assets/styles/global.scss',
],
pwa: {
injectRegister: 'auto',
registerType: 'autoUpdate',
workbox: {
runtimeCaching: [
{ urlPattern: '/', method: 'GET', handler: 'CacheOnly' },
],
globDirectory: resolve('.output', 'public'),
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
swDest: 'public',
},
client: {
registerPlugin: true,
installPrompt: true,
// periodicSyncForUpdates: 0,
},
devOptions: {
enabled: true,
suppressWarnings: true,
navigateFallbackAllowlist: [/^\/$/],
type: 'module',
},
includeAssets: ['favicon.ico'],
manifest: {
start_url: '/',
name: 'Countries Rest API Demo',
short_name: 'Countries Demo',
description: 'Countries Rest API Demo SSR',
theme_color: '#ffffff',
icons,
},
},
})