Skip to content

Commit 57b677a

Browse files
committed
Add support for baseDir in Scripts
1 parent 7c75399 commit 57b677a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/scripts.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import posthog from 'posthog-js';
88
import { useEffect, useState } from 'react';
99

1010
const isProd = process.env.NEXT_PUBLIC_VERCEL_ENV === 'production';
11+
const baseDir = process.env.NEXT_PUBLIC_BASE_DIR || '';
1112

1213
function Reo() {
1314
const reoClientId = process.env.NEXT_PUBLIC_REO_CLIENT_ID;
@@ -58,7 +59,7 @@ function HubSpot() {
5859
// @ts-ignore
5960
const hs = window?._hsq;
6061
if (afterLoad && pathname && hs) {
61-
let path = pathname;
62+
let path = `${baseDir}${pathname}`;
6263
if (searchParams && searchParams.toString()) {
6364
path = path + `?${searchParams.toString()}`;
6465
}

0 commit comments

Comments
 (0)