Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions packages/devtools-vite/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export const defineDevtoolsConfig = (config: TanStackDevtoolsViteConfig) =>

export const devtools = (args?: TanStackDevtoolsViteConfig): Array<Plugin> => {
let port = 5173
let host = 'http'
const enhancedLogsConfig = args?.enhancedLogs ?? { enabled: true }
const injectSourceConfig = args?.injectSource ?? { enabled: true }
const bus = new ServerEventBus(args?.eventBusConfig)
Expand All @@ -71,9 +70,6 @@ export const devtools = (args?: TanStackDevtoolsViteConfig): Array<Plugin> => {
{
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'
Expand Down Expand Up @@ -119,15 +115,6 @@ export const devtools = (args?: TanStackDevtoolsViteConfig): Array<Plugin> => {
}),
)
},
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',
Expand Down
4 changes: 3 additions & 1 deletion packages/devtools/src/devtools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {})
}
}
Expand Down
Loading