mirror of
https://github.com/Kong/insomnia.git
synced 2026-08-04 11:52:33 -04:00
use runtime adapter, instead of bundler shim
This commit is contained in:
@@ -1,4 +1,19 @@
|
||||
// Bundler-time shim: Vite resolves this to network-adapter.renderer.ts,
|
||||
// inso esbuild resolves this to network-adapter.node.ts.
|
||||
// This file is the TypeScript target for type-checking only.
|
||||
export * from './network-adapter.renderer';
|
||||
// Runtime adapter selection: renderer uses IPC bridge, node uses libcurl directly.
|
||||
// Vite production inlines process.type='renderer' so Rollup tree-shakes the node branch.
|
||||
import type * as AdapterType from './network-adapter.renderer';
|
||||
|
||||
const impl = (
|
||||
(process as any).type === 'renderer'
|
||||
? require('./network-adapter.renderer')
|
||||
: require(/* @vite-ignore */ './network-adapter.node')
|
||||
) as typeof AdapterType;
|
||||
|
||||
export const {
|
||||
getTimelinePath,
|
||||
appendToTimelineOnError,
|
||||
appendTimelineLines,
|
||||
getAuthHeader,
|
||||
executeCurlRequest,
|
||||
applyRequestHooks,
|
||||
applyResponseHooks,
|
||||
} = impl;
|
||||
|
||||
Reference in New Issue
Block a user