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

Function resolve

packages/vite/helpers/postcss-platform-config.ts:47–72  ·  view source on GitHub ↗
(id: string, basedir: string)

Source from the content-addressed store, hash-verified

45 },
46 postcssImport({
47 resolve(id: string, basedir: string) {
48 if (id.startsWith('.') || id.startsWith('/')) {
49 const cleanBasedir = basedir ? basedir.split('?')[0] : basedir;
50 let abs = path.resolve(cleanBasedir || '', id);
51 if (!existsSync(abs) && /\.css$/.test(abs)) {
52 const platformExt = platform === 'android' ? '.android.css' : '.ios.css';
53 const alt = abs.replace(/\.css$/, platformExt);
54 if (existsSync(alt)) return alt;
55 }
56 return abs;
57 }
58 if (id.startsWith('nativescript-theme-core/')) {
59 const pkgRoot = themeCoreRoot || findPackageInNodeModules('nativescript-theme-core', projectRoot);
60 if (!pkgRoot) return id;
61 let rel = id.substring('nativescript-theme-core/'.length);
62 let target = path.join(pkgRoot, rel);
63 if (/^css\/.+\.css$/.test(rel)) {
64 const platformExt = platform === 'android' ? '.android.css' : '.ios.css';
65 const base = target.replace(/\.css$/, '');
66 const alt = base + platformExt;
67 if (existsSync(alt)) return alt;
68 }
69 return target;
70 }
71 return id;
72 },
73 load(filename: string) {
74 try {
75 const clean = filename.split('?')[0];

Callers 4

getProjectFilePathFunction · 0.70
solid.tsFile · 0.50
vueConfigFunction · 0.50
react.tsFile · 0.50

Calls 5

findPackageInNodeModulesFunction · 0.85
resolveMethod · 0.80
replaceMethod · 0.80
joinMethod · 0.80
testMethod · 0.45

Tested by

no test coverage detected