chennlang / js-analyzer

🧬 A visual and interactive front-end project dependency analysis tool~ 一个可视化、交互式的前端项目依赖分析工具
https://chennlang.github.io/js-analyzer/
MIT License
83 stars 10 forks source link

自定义配置项,别名无法识别🤔️ #21

Open KangXinzhi opened 2 weeks ago

KangXinzhi commented 2 weeks ago

module.exports = { // Root directory root: "./src", // Directories that do not need to be analyzed ignore: ["/node_modules/", "/dist/"], // Order of preference when parsing files without extensions // extensions: [".js", ".ts", ".tsx", ".vue", ".json", ".jsx"], // Path mapping of the project's alias alias: { "@src/": "src/", "@common/": "src/common/", "@components/": "src/components/", "@typings/": "src/typings/", "@wzTaroUtils": "src/common/utils/taro/index", "@path/": "path/", "@hooks/": "src/hooks/", "@models/": "src/models/", "@api/": "src/models/api/", "@globalDataStore/": "src/globalDataStore/", "@skeleton/": "src/skeleton/", "@baidu/weirwood-mp-sdk/": "node_modules/@baidu/weirwood-mp-sdk/lib/" }, // Server and port related information server: { port: 8088, host: "localhost", openBrowser: true, // Automatically open in browser after startup }, };

chennlang commented 1 week ago

@KangXinzhi 你好,我发现你的自定义配置中有以下问题:

  1. root 必须是完整的绝对路径。
  2. ignore 写法错误,正确写法:ignore: ["**/node_modules/**", "**/dist/**"], 语法参考: https://www.npmjs.com/package/fast-glob#ignore
  3. alias 写法错误,正确写法:"@src/": "/src/",