这几个有javascript代码要分析,一直在折腾。
1、首先要node.js环境(网上自己招,不介绍)
2、使用npm i -g debundle 安装debundle
3、debundle
debundle 用法:debundle [输入文件] {OPTIONS} 选项:
--input,
--i Bundle to debundle
--output,
-o将代码解压缩到的目录。 --config,-c配置文件
#curl https://raw.githubusercontent.com/1egoman/debundle/master/test_bundles/browserify/bundle.js > bundle.js
#curl https://raw.githubusercontent.com/1egoman/debundle/master/test_bundles/browserify/debundle.config.json > debundle.config.json
#cat debundle.config.json
{ "type": "browserify", "knownPaths": {} }
使用命令#debundle -i bundle.js -o dist/ -c debundle.config.json (
bundle.js 是需要被反编译的js dist反编译后输出的目录
debundle.config.json 是反编译的配置文件 )
注意:如果找到debundle命令,需要使用ln -s root/data/debundle /usr/bin/debundle 建立软连接。
注意:如果反编译的过程有错误,debundle.config.json使用如下配置文件
#cat debundle.config.json
{
"type": "webpack",
"knownPaths": {},
"entryPoint": 1,
"moduleAst": ["body", 0, "expression", "argument", "arguments", 0]
}