修的了电脑 敲得了代码
     写得了前端 稳得住后端

使用debundle反编译(解压)webpack打包的javascript代码

这几个有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]
}
赞(3)
未经允许不得转载:流云溪|码农 » 使用debundle反编译(解压)webpack打包的javascript代码