()
| 15 | const FILTER = /node_modules\/(?:@angular|@nativescript\/angular)\/.*\.[mc]?js$/; |
| 16 | |
| 17 | async function ensureDeps() { |
| 18 | if (babel && createLinker) return; |
| 19 | try { |
| 20 | const req = createRequire((projectRoot ? projectRoot + '/package.json' : import.meta.url) as any); |
| 21 | const babelPath = req.resolve('@babel/core'); |
| 22 | |
| 23 | const linkerPath = req.resolve('@angular/compiler-cli/linker/babel'); |
| 24 | babel = await import(babelPath); |
| 25 | const linkerMod: any = await import(linkerPath); |
| 26 | createLinker = linkerMod.createLinkerPlugin || linkerMod.createEs2015LinkerPlugin; |
| 27 | } catch { |
| 28 | try { |
| 29 | babel = await import('@babel/core'); |
| 30 | } catch {} |
| 31 | try { |
| 32 | const linkerMod: any = await import('@angular/compiler-cli/linker/babel'); |
| 33 | createLinker = linkerMod.createLinkerPlugin || linkerMod.createEs2015LinkerPlugin; |
| 34 | } catch {} |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | return { |
| 39 | name: 'ns-angular-linker-rollup', |
no test coverage detected