ionic-team / ionic-team/ionic-cli

bug: www/ folder isn't cleared when doing a release build, causing a huge apk.

未關閉
#3,954 8 則留言 8 個 reaction 已指派 0 人 在 GitHub 檢視
bug needs investigation project type: angular
主要語言
TypeScript
星號
2k
分支
682
PR 合併指標
30 天內沒有已合併 PR

描述

# Bug Report

**Ionic version:**
[x] **4.3**

**Current behavior:**
When executing a release build after a debug build, the `www/` folder is not cleared, and the release build will have debug chunks and sourcemap files inside the apk. This causes a very big `.apk`.

**Expected behavior:**
The `www/` folder should be cleared before performing a release build.

**Steps to reproduce:**
1. `ionic cordova build android`
2. `ionic cordova build android --prod --release`

Without a debug build:
![image](https://user-images.githubusercontent.com/7610043/56666105-95ca1380-66ab-11e9-9b5d-574e7116d4a1.png)

After a debug build:
![image](https://user-images.githubusercontent.com/7610043/56666170-ada19780-66ab-11e9-9588-8cd3bca143c2.png)

Extracted .apk:
![image](https://user-images.githubusercontent.com/7610043/56666376-10932e80-66ac-11e9-83df-d6b93326aa3b.png)

**Workaround**

Execute `rm -rf ./www/` before building a release build.

**Ionic info:**

```
Ionic:

ionic (Ionic CLI) : 4.12.0 (C:\Users\freek\AppData\Roaming\nvm\v10.15.0\node_modules\ionic)
Ionic Framework : @ionic/angular 4.3.0
@angular-devkit/build-angular : 0.13.8
@angular-devkit/schematics : 7.3.8
@angular/cli : 7.3.8
@ionic/angular-toolkit : 1.5.1

Cordova:

cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.1, (and 10 other plugins)

System:

Android SDK Tools : 26.1.1 (C:\Users\freek\AppData\Local\Android\Sdk)
NodeJS : v10.15.0 (C:\program files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10```

貢獻指南

開啟貢獻指南

研究方向

Reproduce the issue with `ionic cordova build android` followed by `ionic cordova build android --prod --release`, then trace the CLI's release-build entry point and its handling of the `www/` folder. Done means a release build no longer includes debug chunks or sourcemaps left by the preceding debug build, while the documented workaround is no longer needed.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
android, typescript
領域
build-system, cli
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。