Skip to content

Instantly share code, notes, and snippets.

@lazuee
Created June 20, 2025 11:12
Show Gist options
  • Save lazuee/4c1f454c7f04c307a3117179115d9271 to your computer and use it in GitHub Desktop.
Save lazuee/4c1f454c7f04c307a3117179115d9271 to your computer and use it in GitHub Desktop.
Parcel SourceMap
import $SourceMap from '@parcel/source-map';
import * as ParcelSourceMap from '@parcel/source-map';
export const SourceMap = (typeof $SourceMap === 'function'
? $SourceMap
// eslint-disable-next-line
: typeof ($SourceMap as any).default === 'function'
// eslint-disable-next-line
? ($SourceMap as any).default
: (typeof ParcelSourceMap === 'function'
? ParcelSourceMap
// eslint-disable-next-line
:(ParcelSourceMap as any).default)
) as typeof $SourceMap;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment