mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-06 21:30:21 +03:00
chore: isBrowser verification improvment
This commit is contained in:
parent
101bf62556
commit
93bf408a0e
|
@ -11,15 +11,16 @@ export async function loadAndBundleSpec(specUrlOrObject: object | string): Promi
|
|||
base: IS_BROWSER ? window.location.href : process.cwd()
|
||||
}
|
||||
|
||||
if (IS_BROWSER) {
|
||||
config.resolve.http.customFetch = global.fetch;
|
||||
}
|
||||
|
||||
if (typeof specUrlOrObject === 'object' && specUrlOrObject !== null) {
|
||||
bundleOpts['doc'] = {
|
||||
source: { absoluteRef: '' } as Source,
|
||||
parsed: specUrlOrObject
|
||||
} as Document
|
||||
} else {
|
||||
if (IS_BROWSER) {
|
||||
config.resolve.http.customFetch = global.fetch;
|
||||
}
|
||||
bundleOpts['ref'] = specUrlOrObject;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user