(id: string, basedir: string)
| 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]; |
no test coverage detected