Skip to content

Commit

Permalink
feat: 支持小游戏编译
Browse files Browse the repository at this point in the history
  • Loading branch information
biggerstar committed Jun 7, 2024
1 parent 250007d commit 0b0eaf8
Show file tree
Hide file tree
Showing 5 changed files with 212 additions and 79 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<br/>


微信小程序反编译工具
微信小程序反编译工具, 支持小程序和小游戏

### 准备

Expand Down Expand Up @@ -58,11 +58,11 @@

### 命令参数

| 参数 | 作用 |
|---------------------|-------------------------------------|
| `<packages...>` | 包所在路径,可以是文件或者目录 |
| `-o, --out` | 产物及输出路径, 未指定默认放到同级目录下的 \_\_OUTPUT__ |
| `-overwrite` | 是否直接覆盖旧产物 |
| 参数 | 作用 |
|-------------------|-------------------------------------|
| `<packages...>` | 包所在路径,可以是文件或者目录 |
| `-o, --out` | 产物及输出路径, 未指定默认放到同级目录下的 \_\_OUTPUT__ |
| `-ow --overwrite` | 是否直接覆盖旧产物 |

### polyfill
在编译过程中, 在包所在文件夹在创建一个 polyfill 目录,如果发现里面的模块和输出到产物中的模块路径名称一致, 将会使用自定义的js模块,忽略原本js模块的编译
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"release:npm": "vite-run build -y && npm publish",
"release:git": "vite-run build -y && git commit -am v$npm_package_version && git tag $npm_package_version && git push --tags ",
"test: cmd": "npx wedecode",
"dev:unpack:file": "DEV=true npx wedecode --overwrite=true -o OUTPUT pkg/mt/__APP__.wxapkg",
"dev:unpack:file": "DEV=true npx wedecode --overwrite=true -o OUTPUT pkg/mini-game/_subpackages_common_.wxapkg",
"dev:unpack:file:nooverwrite": "DEV=true npx wedecode -o OUTPUT pkg/issues2/_pagesA_.wxapkg",
"dev:unpack:dir": "DEV=true npx wedecode --overwrite=true -o OUTPUT pkg/mt",
"dev:unpack:dir": "DEV=true npx wedecode -ow true -o OUTPUT pkg/mini-game",
"dev:unpack:subPack": "DEV=true npx wedecode --overwrite=true -o OUTPUT pkg/mt/_mobike_.wxapkg",
"preview:unpack": "npx wedecode pkg/old/__old__.wxapkg"
},
Expand Down
2 changes: 1 addition & 1 deletion src/bin/wedecode/wedecode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ program
.description('\u25B6 wxapkg 解包工具')
.version(pkg.version)
.option("-o, --out <out-path>", '指定编译输出地目录, 正常是主包目录')
.option("--overwrite <overwrite>", '直接覆盖旧的产物')
.option("-ow --overwrite <overwrite>", '直接覆盖旧的产物')
.action(async (argMap: Record<any, any>, options: Record<any, any>) => {
await sleep(200)
const args = options.args || []
Expand Down
6 changes: 6 additions & 0 deletions src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ export function getPathInfo(outputDir: string) {
get appServicePath() {
return resolve('app-service.js')
},
get gameJsPath() {
return resolve('game.js')
},
get gameJsonPath() {
return resolve('game.json')
},
}
}

Expand Down
Loading

0 comments on commit 0b0eaf8

Please sign in to comment.