ionic-team / ionic-team/ionic-cli

Filenames are not the same when building with and without sourcemaps

Open
#4,658 0 comments 1 reaction 0 assignees View on GitHub
triage
Dominant language
TypeScript
Stars
2k
Forks
682
PR merge metrics
No merged PRs in 30d

Description

**Description:**

The filenames generated by
`ionic build --prod --source-map`
and
`ionic build --prod`
are not the same.

To give an idea. This is the www folder with `ionic build --prod --source-map`
![image](https://user-images.githubusercontent.com/644550/111912597-aa1b1480-8a6a-11eb-9fab-01b084ae4a0b.png)

And this with `ionic build --prod`
![image](https://user-images.githubusercontent.com/644550/111912608-b56e4000-8a6a-11eb-8a97-00e9c80c421a.png)

As you can see the file names differ. This is especially an issue when using Sentry where the uploaded sourcemaps need to be the same as the filenames in the app packages.

Building the Android build with sourcemaps is an issue, because all .map files becoming part of the APK package which we don't want.

**Steps to Reproduce:**

Build an Ionic project with:
`ionic build --prod --source-map`
and
`ionic build --prod`

**Output:**

**My `ionic info`:**

Ionic CLI : 6.12.4 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.3.4
@angular-devkit/build-angular : 0.1000.8
@angular-devkit/schematics : 10.0.8
@angular/cli : 10.0.8
@ionic/angular-toolkit : 2.3.3

Capacitor:

Capacitor CLI : 2.1.0
@capacitor/core : 2.4.1

Utility:

cordova-res (update available: 0.15.3) : 0.14.0
native-run (update available: 1.3.0) : 0.3.0

System:

NodeJS : v12.13.0 (/usr/local/bin/node)
npm : 6.14.5
OS : macOS Catalina
```

```

**Other Information:**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.