File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,14 @@ const nextConfig = {
11
11
] ,
12
12
deviceSizes : [ 1080 , 1920 ] ,
13
13
} ,
14
+ async rewrites ( ) {
15
+ return [
16
+ {
17
+ source : "/script.analytics.js" ,
18
+ destination : "https://cloud.umami.is/script.js" ,
19
+ } ,
20
+ ] ;
21
+ } ,
14
22
} ;
15
23
16
24
module . exports = nextConfig ;
Original file line number Diff line number Diff line change @@ -4,11 +4,13 @@ export default function Document() {
4
4
return (
5
5
< Html lang = "en" >
6
6
< Head >
7
- < script
8
- async
9
- src = "https://analytics.umami.is/script.js"
10
- data-website-id = { process . env . NEXT_PUBLIC_UMAMI_WEBSITE_ID }
11
- > </ script >
7
+ { process . env . NODE_ENV === "production" && (
8
+ < script
9
+ defer
10
+ src = "/script.analytics.js"
11
+ data-website-id = { process . env . NEXT_PUBLIC_UMAMI_ID }
12
+ />
13
+ ) }
12
14
</ Head >
13
15
< body >
14
16
< Main />
You can’t perform that action at this time.
0 commit comments