A easy way for cli/utils to resolve dependencies.
Use glob for entry generate, precinct for ast dependencies resolve, enhanced-resolve for dependencies absolute path resolve.
yarn add resolve-deps
const path = require('path');
const { resolveDependenciesArray } = require('resolve-deps');
const deps = await resolveDependenciesArray({
entry: [path.join(__dirname, 'entry.ts')],
resolve: {
recursion: true,
extensions: ['.ts'],
ignore: (dep) => !(dep.startsWith('.') || dep.startsWith('/')),
}
});
-
check dependencies declaration integrity in
package.json
file when use mono-repo.
MIT