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

Function config

packages/vite/helpers/prelink-angular.ts:87–101  ·  view source on GitHub ↗
(_user, _env)

Source from the content-addressed store, hash-verified

85 name: 'ns-angular-prelink',
86 enforce: 'pre',
87 async config(_user, _env) {
88 const debug = process.env.VITE_DEBUG_LOGS === 'true' || process.env.VITE_DEBUG_LOGS === '1';
89 const disabled = process.env.NS_PRELINK === '0' || process.env.NS_PRELINK === 'false';
90 if (disabled) return {};
91 // Prelink synchronously to ensure alias points to ready files.
92 for (const pkg of pkgs) {
93 await prelinkPackage(req, pkg, cacheRoot, !!debug);
94 }
95 done = true;
96 const alias = [
97 { find: /^@angular\//, replacement: path.join(cacheRoot, '@angular') + '/' },
98 { find: /^@nativescript\/angular(\/.*)?$/, replacement: (_: string, sub: string) => path.join(cacheRoot, '@nativescript', 'angular') + (sub || '') },
99 ] as any;
100 return { resolve: { alias } };
101 },
102 async buildStart() {
103 if (done) return;
104 const disabled = process.env.NS_PRELINK === '0' || process.env.NS_PRELINK === 'false';

Callers

nothing calls this directly

Calls 2

prelinkPackageFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected