/
githubmirror
/
meteor
Обзор
Документация
Войти
/
githubmirror
/
meteor
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
devel
tools/cli/dev-bundle-helpers.js
25 строк
942 B
Matheus Castro
Remove Fibers for Meteor Tools:
15 дек 2022, 03:48
15 дек 2022, 03:48
a76c306
Код
Авторство
О чём код?
import { pathJoin, getDevBundle, statOrNull } from '../fs/files'; import { installNpmModule } from '../isobuild/meteor-npm.js'; export async function ensureDependencies(deps) { const devBundleLib = pathJoin(getDevBundle(), 'lib'); const devBundleNodeModules = pathJoin(devBundleLib, 'node_modules'); // Check if each of the requested dependencies resolves, if not // mark them for installation. const needToInstall = Object.create(null); Object.keys(deps).forEach(dep => { const pkgDir = pathJoin(devBundleNodeModules, dep); const pkgStat = statOrNull(pkgDir); const alreadyInstalled = pkgStat && pkgStat.isDirectory(); if (!alreadyInstalled) { const versionToInstall = deps[dep]; needToInstall[dep] = versionToInstall; } }); // Install each of the requested modules. for (const dep of Object.keys(needToInstall)) { await installNpmModule(dep, needToInstall[dep], devBundleLib); } }