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

Function ensureDeps

packages/vite/configuration/angular.ts:17–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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',

Callers 2

loadFunction · 0.70
transformFunction · 0.70

Calls 2

resolveMethod · 0.80
createRequireFunction · 0.50

Tested by

no test coverage detected