File tree Expand file tree Collapse file tree
packages/analytics/src/plugin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ export function withSimpleAnalytics(
4545
4646 const clientHints = buildClientHintHeaders ( options ?. clientHints ) ;
4747
48+ const basePathOption = nextConfig . basePath ? { basePath : false as const } : { } ;
49+
4850 const nextAnalyticsConfig : NextConfig = {
4951 async rewrites ( ) {
5052 const existingRewrites = await nextConfig . rewrites ?.( ) ;
@@ -53,14 +55,17 @@ export function withSimpleAnalytics(
5355 {
5456 source : "/proxy.js" ,
5557 destination : `https://simpleanalyticsexternal.com/proxy.js?hostname=${ hostname } &path=/simple` ,
58+ ...basePathOption ,
5659 } ,
5760 {
5861 source : "/auto-events.js" ,
5962 destination : "https://scripts.simpleanalyticscdn.com/auto-events.js" ,
63+ ...basePathOption ,
6064 } ,
6165 {
6266 source : "/simple/:match*" ,
6367 destination : "https://queue.simpleanalyticscdn.com/:match*" ,
68+ ...basePathOption ,
6469 } ,
6570 ] ;
6671
You can’t perform that action at this time.
0 commit comments