MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / shouldRemapImport

Function shouldRemapImport

packages/vite/hmr/server/websocket.ts:640–652  ·  view source on GitHub ↗

* Check if an import spec should be remapped to dep-*.mjs

(spec: string)

Source from the content-addressed store, hash-verified

638 * Check if an import spec should be remapped to dep-*.mjs
639 */
640function shouldRemapImport(spec: string): boolean {
641 if (!spec || typeof spec !== 'string') return false;
642 if (VENDOR_PACKAGES.test(spec)) return false;
643 if (isNativeScriptCoreModule(spec)) return false;
644 if (isNativeScriptPluginModule(spec)) return false;
645 if (resolveVendorFromCandidate(spec)) return false;
646 if (spec.startsWith('~/')) return false;
647 if (SKIP_PATTERNS.test(spec)) return false;
648 if (!spec.startsWith('/') && !spec.startsWith('./') && !spec.startsWith('../')) {
649 return false;
650 }
651 return true;
652}
653
654// (legacy wrapSfcWithStableDefault removed; full SFCs now delegate to /ns/asm)
655

Callers 2

collectDepsFunction · 0.85

Calls 4

isNativeScriptCoreModuleFunction · 0.85
testMethod · 0.45

Tested by

no test coverage detected