forked from fastapi/full-stack-fastapi-template
-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathnuxt.config.ts
162 lines (162 loc) · 4.41 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
app: {
head: {
meta: [
{ charset: "utf-8" },
// <meta name="viewport" content="width=device-width, initial-scale=1">
{ name: "viewport", content: "width=device-width, initial-scale=1" }
],
script: [
// <script src="https://myawesome-lib.js"></script>
// { src: "@/assets/css/main.css" }
],
noscript: [
// <noscript>Javascript is required</noscript>
{ children: "Javascript is required" }
]
},
// pageTransition: { name: "page", mode: "out-in" }
},
runtimeConfig: {
// https://nuxt.com/docs/api/composables/use-runtime-config#using-the-env-file
// Private keys are only available on the server
apiSecret: process.env.VUE_PRIVATE_TERM,
// Public keys that are exposed to the client
public: {
appName: process.env.VUE_APP_NAME,
appEnv: process.env.VUE_APP_ENV,
apiWS: process.env.VUE_APP_DOMAIN_WS,
apiUrl: process.env.VUE_APP_DOMAIN_API,
// idbName: process.env.VUE_IDB_NAME,
// idbVersion: process.env.VUE_IDB_VERSION,
}
},
modules: [
"@nuxtjs/i18n",
"@pinia/nuxt",
"@pinia-plugin-persistedstate/nuxt",
"@nuxt/content",
"tailwindcss",
"@nuxtjs/robots",
"@vite-pwa/nuxt",
],
// pinia: {
// autoImports: [
// "definePiniaStore",
// "defineStore",
// ],
// },
piniaPersistedstate: {
cookieOptions: {
path: "/",
// maxAge: 60 * 60 * 24 * 30,
secure: true,
},
},
content: {
// https://content.nuxtjs.org/api/configuration
// https://stackblitz.com/edit/nuxt-starter-jnysug
// https://stackoverflow.com/q/76421724
navigation: {
fields: ["title", "author", "publishedAt"]
},
locales: ["en", "fr"],
defaultLocale: "en",
},
i18n: {
// https://phrase.com/blog/posts/nuxt-js-tutorial-i18n/
// https://v8.i18n.nuxtjs.org/
// https://stackblitz.com/edit/nuxt-starter-jnysug
locales: [
{
code: "en",
name: "English",
iso: "en-GB",
dir: "ltr",
file: "en-GB.ts",
},
{
code: "fr",
name: "Français",
iso: "fr-FR",
dir: "ltr",
file: "fr-FR.ts",
}
],
defaultLocale: "en",
detectBrowserLanguage: false,
lazy: true,
langDir: "locales",
strategy: "prefix_and_default",
vueI18n: "./config/i18n.ts",
},
robots: {
// https://nuxt.com/modules/robots
rules: [
{
UserAgent: "GPTBot",
Disallow: "/"
},
]
},
pwa: {
// https://vite-pwa-org.netlify.app/frameworks/nuxt.html
// https://github.com/vite-pwa/nuxt/blob/main/playground
// Generate icons with:
// node node_modules/@vite-pwa/assets-generator/bin/pwa-assets-generator.mjs --preset minimal public/images/logo.svg
registerType: "autoUpdate",
manifest: {
name: "Nuxt FastAPI Base App",
short_name: "NuxtFastAPIApp",
theme_color: "#f43f5e",
icons: [
{
src: 'pwa-64x64.png',
sizes: '64x64',
type: 'image/png'
},
{
src: 'pwa-192x192.png',
sizes: '192x192',
type: 'image/png'
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any'
},
{
src: 'maskable-icon-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'maskable'
}
],
},
workbox: {
navigateFallback: "/",
globPatterns: ["**/*.{js,json,css,html,txt,svg,png,icon,ebpt,woff,woff2,ttf,eot,otf,wasm}"]
},
client: {
installPrompt: true,
},
devOptions: {
enabled: true,
suppressWarnings: true,
navigateFallbackAllowlist: [/^\/$/],
type: "module",
},
},
css: ["~/assets/css/main.css"],
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
build: {
transpile: ["@heroicons/vue"]
}
})