MCPcopy Create free account
hub / github.com/angular/angular / resolveWasmBinding

Function resolveWasmBinding

packages/compiler-cli/preprocessor/test/utils.ts:40–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38}
39
40export function resolveWasmBinding(): string {
41 if (process.env['NGP_WASM_BINDING']) {
42 return process.env['NGP_WASM_BINDING'];
43 }
44 const runfilesDir = process.env['JS_BINARY__RUNFILES'] || process.env['RUNFILES_DIR'];
45 if (runfilesDir) {
46 const candidates = [
47 path.join(
48 runfilesDir,
49 '_main/packages/compiler-cli/preprocessor/ng-analyze/ng_analyze_wasm/ng_analyze_wasm.js',
50 ),
51 path.join(
52 runfilesDir,
53 'angular/packages/compiler-cli/preprocessor/ng-analyze/ng_analyze_wasm/ng_analyze_wasm.js',
54 ),
55 path.join(
56 runfilesDir,
57 'packages/compiler-cli/preprocessor/ng-analyze/ng_analyze_wasm/ng_analyze_wasm.js',
58 ),
59 ];
60 for (const c of candidates) {
61 if (fsSync.existsSync(c)) {
62 return c;
63 }
64 }
65 }
66 const relativeCandidates = [
67 path.resolve(
68 process.cwd(),
69 '../../packages/compiler-cli/preprocessor/ng-analyze/ng_analyze_wasm/ng_analyze_wasm.js',
70 ),
71 path.resolve(
72 process.cwd(),
73 'dist/bin/packages/compiler-cli/preprocessor/ng-analyze/ng_analyze_wasm/ng_analyze_wasm.js',
74 ),
75 ];
76 for (const c of relativeCandidates) {
77 if (fsSync.existsSync(c)) {
78 return c;
79 }
80 }
81 throw new Error(
82 `Could not find ng_analyze_wasm.js in runfiles. Checked runfilesDir=${runfilesDir}, cwd=${process.cwd()}`,
83 );
84}
85
86export function resolveSidecarBinary(): string {
87 const ext = process.platform === 'win32' ? '.exe' : '';

Callers 10

createSessionFunction · 0.70
setupCompilerFunction · 0.70
setupMultiFileCompilerFunction · 0.70
runPipelineFunction · 0.70
createCompilerFunction · 0.70
createIncrementalSessionFunction · 0.70
perf_spec.tsFile · 0.70

Calls 2

joinMethod · 0.65
resolveMethod · 0.65

Tested by

no test coverage detected