-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
113 lines (109 loc) · 2.68 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
import { defineNuxtConfig } from "nuxt/config";
import { markdown } from "./rollupPlugins";
export default defineNuxtConfig({
css: ["~/global.css"],
postcss: {
plugins: {
"tailwindcss/nesting": "postcss-nesting",
tailwindcss: {},
autoprefixer: {},
},
},
nitro: {
rollupConfig: {
//@ts-ignore
plugins: [markdown()],
},
},
vite: {
plugins: [markdown()],
},
runtimeConfig: {
public: {
disableAnalytics: process.env.DISABLE_ANALYTICS === "true",
},
},
app: {
// this appears to be breaking things...
// pageTransition: {
// name: "fade",
// mode: "out-in",
// },
head: {
bodyAttrs: {
class:
"h-full flex flex-col leading-normal bg-gray-50 transition text-base",
},
link: [
// favicon
{
rel: "icon",
type: "image/png",
href: "/favicon/favicon-32x32.png",
sizes: "32x32",
},
{
rel: "icon",
type: "image/png",
href: "/favicon/favicon-16x16.png",
sizes: "16x16",
},
{
rel: "apple-touch-icon",
sizes: "180x180",
href: "/favicon/apple-touch-icon.png",
},
{
rel: "manifest",
href: "/favicon/site.webmanifest",
},
{
rel: "mask-icon",
href: "/favicon/safari-pinned-tab.svg",
color: "#5bbad5",
},
// typekit
{
rel: "preconnect",
href: "https://use.typekit.net",
},
{
rel: "preload",
href: "https://use.typekit.net/gwp5zpe.css",
as: "style",
onload: "this.onload=null;this.rel='stylesheet'",
},
],
meta: [
// misc
{ name: "msapplication-TileColor", content: "#00aba9" },
{ name: "theme-color", content: "#ffffff" },
],
script: [
{
hid: "gtag",
src: "https://www.googletagmanager.com/gtag/js?id=G-VJ6EPKW4FM",
async: true,
defer: true,
},
{
hid: "set-theme-early",
innerHTML: /* js */ `
// set the color theme based on localstorage before loading the app to avoid a flash of white when a user prefers a dark theme
const stored = localStorage.theme;
const preferred = window?.matchMedia("(prefers-color-scheme: dark)").matches
? "dark"
: "light";
const otherwise = "dark";
const theme = stored ?? preferred ?? otherwise;
if (theme === "dark") {
document.documentElement.classList.add("dark");
} else {
document.documentElement.classList.remove("dark");
}
`,
},
],
},
},
});