UNPKG

@rws-framework/client

Version:

This package provides the core client-side framework for Realtime Web Suit (RWS), enabling modular, asynchronous web components, state management, and integration with backend services. It is located in `.dev/client`.

37 lines (28 loc) 1.3 kB
const path = require('path'); const fs = require('fs'); const packageNames = [ 'client', 'nest-interconnectors' ]; async function loadAliases(packageDir, tsConfig, nodeModulesPath, executionDir){ console.log({packageDir, tsConfig, nodeModulesPath, executionDir}) const tsPaths = {} for(const aliasKey of Object.keys(tsConfig.config.compilerOptions.paths)){ const alias = tsConfig.config.compilerOptions.paths[aliasKey]; tsPaths[aliasKey] = path.resolve(executionDir, alias[0]); } for(const pkgName of packageNames){ const symlinkPath = path.join(nodeModulesPath, '@rws-framework', pkgName); if(fs.existsSync(symlinkPath)){ const targetPath = await fs.promises.realpath(symlinkPath); tsPaths['@rws-framework/' + pkgName + '/*'] = targetPath + '/*'; tsPaths['@rws-framework/' + pkgName] = targetPath + '/src/index.ts'; } } return { ...tsPaths, '@rws-framework/foundation': path.resolve(packageDir, 'foundation', 'rws-foundation.js'), '@rws-framework/foundation/*': path.resolve(packageDir, 'foundation', '*'), } } module.exports = { loadAliases }