{"id":29926782,"url":"https://github.com/ecomfe/amd-analyzer","last_synced_at":"2025-08-02T12:44:04.560Z","repository":{"id":16664986,"uuid":"19420627","full_name":"ecomfe/amd-analyzer","owner":"ecomfe","description":null,"archived":false,"fork":false,"pushed_at":"2015-12-30T12:24:46.000Z","size":242,"stargazers_count":26,"open_issues_count":0,"forks_count":2,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-14T20:16:30.978Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ecomfe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-04T06:46:25.000Z","updated_at":"2019-10-05T09:56:50.000Z","dependencies_parsed_at":"2022-09-14T22:20:14.285Z","dependency_job_id":null,"html_url":"https://github.com/ecomfe/amd-analyzer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ecomfe/amd-analyzer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Famd-analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Famd-analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Famd-analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Famd-analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ecomfe","download_url":"https://codeload.github.com/ecomfe/amd-analyzer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecomfe%2Famd-analyzer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268392301,"owners_count":24243299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-02T12:43:12.414Z","updated_at":"2025-08-02T12:44:04.163Z","avatar_url":"https://github.com/ecomfe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"AMD Analyzer\n=====================\n\n一个chrome extension，可以分析页面中的AMD module之间的依赖关系，也能找出当前页面中的amd相关错误。\n\n\n### 安装\n\n由于可能添加新功能，所以推荐通过github，从源码安装。\n\n#### Step 1\n\n```\n$ git clone https://github.com/ecomfe/amd-analyzer.git\n```\n\n#### Step 2\n\n打开chrome的插件页面：[chrome://extensions](chrome://extensions)\n\n#### Step 3\n\n点击`加载正在开发的应用程序`\n\n![step3](http://boscdn.bpc.baidu.com/mms-res/amd/install.png)\n\n#### Step 4\n\n选择`Step 1`中clone到的目录\n\n安装完之后，我们可以看到如下所示：\n![step4](http://boscdn.bpc.baidu.com/mms-res/amd/app.png)\n\n\n#### step 5\n\n访问一个开发中或线上的url, 如果当前页面中含有amd环境，将会出现下图所示的icon\n\n![step5](http://boscdn.bpc.baidu.com/mms-res/amd/enter.png)\n\n点击icon将会进入amd-analyzer分析页面。页面分为两个部分，左边的分析区和右边 的log区\n\n下图为分析区的初始状态， 红色按钮中的模块为inline script中的入口模块， 绿色按钮为在某文件中的入口模块, 蓝色按钮为require.config信息\n![enter modules](http://boscdn.bpc.baidu.com/mms-res/amd/entermodules.png)\n![enter modules](http://boscdn.bpc.baidu.com/mms-res/amd/entermodules2.png)\n\n下图为log区的初始状态，log区的日志支持filter过滤\n![log](http://boscdn.bpc.baidu.com/mms-res/amd/info.png)\n\n\n#### step 6\n\n点击每个按钮，能分别看到分析的结果，如果在分析中有错误，会显示在右边。\n\n下图为点击config获取的当前页面的require.config信息\n![require.config](http://boscdn.bpc.baidu.com/mms-res/amd/config.png)\n\n下图是点击某个入口模块的依赖分析图（默认是不分析状态，需要点击入口模块，相当于指定入口）\n![analyse](http://boscdn.bpc.baidu.com/mms-res/amd/analyse.png)\n\n\n#### 最后\n\n可以根据右边的log区的日志，进行分析，定位问题。\n\n\n### 说明\n\n#### 关于装载时依赖\n\n```javascript\n// a是装载时依赖，b是运行时依赖\ndefine( [ 'a', 'b' ], function ( a ) {} );\n\n// a是装载时依赖，b是运行时依赖\ndefine( function ( require ) {\n    var a = require( 'a' );\n    return function () {\n        var b = require( 'b' );\n    };\n} );\n```\n\n#### 关于入口模块\n\n入口模块指的是页面中以async方式调用的require。\n\n```javascript\nrequire( [ 'main' ], function ( main ) {\n    main.init();\n});\n```\n\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecomfe%2Famd-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecomfe%2Famd-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecomfe%2Famd-analyzer/lists"}