| 15 | let createLinker: any = null; |
| 16 | |
| 17 | async function ensureDeps() { |
| 18 | if (babel && createLinker) return; |
| 19 | try { |
| 20 | const babelPath = req.resolve('@babel/core'); |
| 21 | const linkerPath = req.resolve('@angular/compiler-cli/linker/babel'); |
| 22 | babel = (await import(babelPath)) as any; |
| 23 | const linkerMod = await import(linkerPath); |
| 24 | createLinker = (linkerMod as any).createLinkerPlugin || (linkerMod as any).createEs2015LinkerPlugin || null; |
| 25 | } catch { |
| 26 | // Fall back to hoisted resolution if necessary |
| 27 | try { |
| 28 | babel = (await import('@babel/core')) as any; |
| 29 | } catch {} |
| 30 | try { |
| 31 | const linkerMod = await import('@angular/compiler-cli/linker/babel'); |
| 32 | createLinker = (linkerMod as any).createLinkerPlugin || (linkerMod as any).createEs2015LinkerPlugin || null; |
| 33 | } catch {} |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | // Base filter: Angular framework libraries + NativeScript Angular + its polyfills bundle. |
| 38 | const FILTER = /node_modules\/(?:@angular|@nativescript\/angular)\/.*\.[mc]?js$|nativescript-angular-polyfills\.mjs$/; |