diff --git a/packages/devtools-vite/src/plugin.ts b/packages/devtools-vite/src/plugin.ts index 0d55d2e2..dfe2669a 100644 --- a/packages/devtools-vite/src/plugin.ts +++ b/packages/devtools-vite/src/plugin.ts @@ -44,7 +44,6 @@ export const defineDevtoolsConfig = (config: TanStackDevtoolsViteConfig) => export const devtools = (args?: TanStackDevtoolsViteConfig): Array => { let port = 5173 - let host = 'http' const enhancedLogsConfig = args?.enhancedLogs ?? { enabled: true } const injectSourceConfig = args?.injectSource ?? { enabled: true } const bus = new ServerEventBus(args?.eventBusConfig) @@ -71,9 +70,6 @@ export const devtools = (args?: TanStackDevtoolsViteConfig): Array => { { enforce: 'pre', name: '@tanstack/devtools:custom-server', - configResolved(config) { - host = config.server.https?.cert ? 'https' : 'http' - }, apply(config) { // Custom server is only needed in development for piping events to the client return config.mode === 'development' @@ -119,15 +115,6 @@ export const devtools = (args?: TanStackDevtoolsViteConfig): Array => { }), ) }, - transform(code) { - if (code.includes('__TSD_PORT__')) { - code = code.replace('__TSD_PORT__', String(port)) - } - if (code.includes('__TSD_HOST__')) { - code = code.replace('__TSD_HOST__', host) - } - return code - }, }, { name: '@tanstack/devtools:better-console-logs', diff --git a/packages/devtools/src/devtools.tsx b/packages/devtools/src/devtools.tsx index b02664ef..ab5270cf 100644 --- a/packages/devtools/src/devtools.tsx +++ b/packages/devtools/src/devtools.tsx @@ -174,7 +174,9 @@ export default function DevTools() { e.preventDefault() e.stopPropagation() fetch( - `__TSD_HOST__://localhost:__TSD_PORT__/__tsd/open-source?source=${encodeURIComponent(dataSource)}`, + `${location.origin}/__tsd/open-source?source=${encodeURIComponent( + dataSource, + )}`, ).catch(() => {}) } }