MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / copyOrLinkInto

Function copyOrLinkInto

packages/vite/helpers/prelink-angular.ts:36–45  ·  view source on GitHub ↗
(babel: any, createLinker: any, srcFile: string, cacheFile: string)

Source from the content-addressed store, hash-verified

34}
35
36async function copyOrLinkInto(babel: any, createLinker: any, srcFile: string, cacheFile: string) {
37 const dir = path.dirname(cacheFile);
38 await ensureDir(dir);
39 const linked = await linkFile(babel, createLinker, srcFile);
40 if (linked) {
41 await fs.writeFile(cacheFile, linked, 'utf8');
42 } else {
43 await fs.copyFile(srcFile, cacheFile);
44 }
45}
46
47async function prelinkPackage(req: NodeRequire, pkgName: string, cacheRoot: string, debug: boolean) {
48 const pkgEntry = req.resolve(path.join(pkgName, 'package.json'));

Callers 1

prelinkPackageFunction · 0.85

Calls 2

ensureDirFunction · 0.85
linkFileFunction · 0.85

Tested by

no test coverage detected