Skip to content

Commit cfabb7d

Browse files
committed
feat(server): check basePath and set option
1 parent 8d1eda5 commit cfabb7d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/analytics/src/plugin/with-simple-analytics.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,21 @@ export function withSimpleAnalytics(
4848
const nextAnalyticsConfig: NextConfig = {
4949
async rewrites() {
5050
const existingRewrites = await nextConfig.rewrites?.();
51+
const basePath = !nextConfig.basePath;
5152

5253
const rewrites = [
5354
{
55+
basePath,
5456
source: "/proxy.js",
5557
destination: `https://simpleanalyticsexternal.com/proxy.js?hostname=${hostname}&path=/simple`,
5658
},
5759
{
60+
basePath,
5861
source: "/auto-events.js",
5962
destination: "https://scripts.simpleanalyticscdn.com/auto-events.js",
6063
},
6164
{
65+
basePath,
6266
source: "/simple/:match*",
6367
destination: "https://queue.simpleanalyticscdn.com/:match*",
6468
},

0 commit comments

Comments
 (0)