generated from divasilevski/nuxt-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
97 lines (94 loc) · 2.05 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import svgLoader from 'vite-svg-loader'
import mdPlugin, { Mode } from 'vite-plugin-markdown'
import manifest from './constants/manifest'
import colors from './constants/palette'
import meta from './constants/meta'
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
ssr: false,
devServer: {
port: 2023,
},
modules: [
'@nuxtjs/html-validator',
'@nuxtjs/tailwindcss',
'@vite-pwa/nuxt',
'nuxt-purgecss',
'@vueuse/nuxt',
'@pinia/nuxt',
],
purgecss: {
enabled: true,
safelist: { greedy: [/v-/, /simplebar/] },
},
tailwindcss: {
viewer: false, // doesn't work without ssr
},
vite: {
plugins: [
svgLoader({
defaultImport: 'component',
svgoConfig: {
plugins: [
{
name: 'preset-default',
params: { overrides: { removeViewBox: false } },
},
],
},
}),
mdPlugin({ mode: [Mode.VUE] }),
],
},
htmlValidator: {
options: {
rules: {
'prefer-native-element': 'off', // Conflict with Simplebar
},
},
},
app: {
keepalive: true,
head: {
title: 'MrBeam',
htmlAttrs: { lang: 'en' },
link: [
{ rel: 'icon', href: '/favicon.svg', sizes: 'any' },
{ rel: 'icon', type: 'image/svg+xml', href: '/favicon.svg' },
{ rel: 'mask-icon', href: '/mask-icon.svg', color: colors.primary },
{ rel: 'apple-touch-icon', href: '/apple-touch-icon.png' },
],
meta,
},
},
// pwa settings
experimental: {
payloadExtraction: false,
},
nitro: {
esbuild: {
options: {
target: 'esnext',
},
},
prerender: {
routes: ['/', '/docs'],
},
},
pwa: {
registerType: 'autoUpdate',
workbox: {
navigateFallback: '/',
globPatterns: ['**/*.{js,css,html,png,svg}'],
},
client: {
installPrompt: true,
periodicSyncForUpdates: 3600,
},
devOptions: {
enabled: true,
type: 'module',
},
manifest,
},
})