MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / resolveId

Function resolveId

packages/vite/helpers/resolver.ts:9–26  ·  view source on GitHub ↗
(source, importer)

Source from the content-addressed store, hash-verified

7 name: 'vite:nativescript',
8
9 resolveId(source, importer) {
10 const platform = options.platform;
11 if (!platform || !importer || source.startsWith('.') === false) {
12 return null;
13 }
14
15 const resolved = path.resolve(path.dirname(importer), source);
16 const extVariants = ['.ts', '.js'];
17
18 for (const ext of extVariants) {
19 const file = resolveNativeScriptPlatformFile(resolved + ext, platform);
20 if (file) {
21 return file;
22 }
23 }
24
25 return null;
26 },
27
28 transform(code, id) {
29 if (id.endsWith('.xml')) {

Callers

nothing calls this directly

Calls 2

resolveMethod · 0.80

Tested by

no test coverage detected