-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
122 lines (106 loc) · 2.59 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
import vueJsx from "@vitejs/plugin-vue-jsx";
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
modules: [
"@pinia/nuxt",
"@nuxtjs/sanity",
"@nuxtjs/plausible",
"nuxt3-lenis",
"nuxt-viewport",
],
plugins: [
{ src: "~/plugins/device/deviceInfo.ts", mode: "client" },
{ src: "~/plugins/device/deviceDimensions.ts", mode: "client" },
{ src: "~/plugins/device/deviceMotionPreference.ts", mode: "client" },
{ src: "~/plugins/device/deviceThemePreference.ts", mode: "client" },
{ src: "~/plugins/device/deviceScroll.ts", mode: "client" },
{ src: "~/plugins/device/deviceResize.ts", mode: "client" },
{ src: "~/plugins/device/deviceResize.ts", mode: "client" },
"~/plugins/sanity/sanity-image-builder.js",
],
pinia: {
storesDirs: ["./stores/app", "./stores/device"],
},
future: {
compatibilityVersion: 4,
},
routeRules: {
"/": { prerender: true },
"/about": { prerender: true },
"/contact": { prerender: true },
},
app: {
head: {
htmlAttrs: {
lang: "en",
},
},
},
// remove entry.css file from manifest in favor of inlining styles in app.vue
hooks: {
"build:manifest": (manifest: any) => {
const css = manifest["node_modules/nuxt/dist/app/entry.js"]?.css;
if (css) {
for (let i = css.length - 1; i >= 0; i--) {
if (css?.[i]?.startsWith("entry")) css.splice(i, 1);
}
}
},
},
nitro: {
preset: "netlify",
},
plausible: {
ignoredHostnames: ["localhost"],
},
runtimeConfig: {
encryptionKey: process.env.ENCRYPTION_KEY,
public: {
muxEnvKey: process.env.MUX_ENV_KEY,
},
},
// Details on warning in console: https://github.com/nuxt-modules/sanity/issues/1059
sanity: {
projectId: "5jjj3zhb",
dataset: "production",
apiVersion: "2022-03-07",
},
typescript: {
typeCheck: true,
strict: false,
},
vue: {
compilerOptions: {
isCustomElement: (tag) => tag.startsWith("mux-player"),
},
},
vite: {
css: {
preprocessorOptions: {
scss: {
api: "modern",
additionalData: `
@use "~/assets/styles/_global.scss" as *;
`,
},
},
},
},
viewport: {
breakpoints: {
mobile: 360,
phablet: 430,
tablet: 600,
laptop: 1024,
desktop: 1350,
ultrawide: 1660,
},
fallbackBreakpoint: "tablet",
defaultBreakpoints: {
mobile: "phablet",
tablet: "tablet",
desktop: "desktop",
},
},
compatibilityDate: "2025-01-27",
});