Skip to content

从一个入口文件出发, 递归构建模块依赖树。常用于文件依赖分析等方向,支持js、ts、tsx、.vue等文件模块。

Notifications You must be signed in to change notification settings

FEyudong/scanDepsTree

Repository files navigation

scanDepsTree

扫描js模块依赖树

简介

从一个入口文件出发, 递归构建模块依赖树。常用于文件依赖分析、代码治理等方向,支持js、ts、tsx、.vue等丰富的模块类型。

安装

npm i scan-deps-tree -D

使用

  1. 命令行使用
npx scan xxx.js //分析的路径

执行完会在当前目录创建depTree.json文件

  1. 导出函数使用
import scanDepsTree from 'scan-deps-tree'

const depTree = scanDepsTree('./src/index.ts',{
    resolveAlias:{ // webpack中配置的路径别名
        @:'xxx'
    },
    skipTypeImport: true // 是否忽略import type xxx的模块声明。默认为true
})
console.log(depTree)

About

从一个入口文件出发, 递归构建模块依赖树。常用于文件依赖分析等方向,支持js、ts、tsx、.vue等文件模块。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published