Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ionic4 --source-map and cordova issues #3890

Closed
mburger81 opened this issue Mar 4, 2019 · 5 comments
Closed

ionic4 --source-map and cordova issues #3890

mburger81 opened this issue Mar 4, 2019 · 5 comments

Comments

@mburger81
Copy link

Description:
running ionic cordova build android --prod --release --source-map does not clean the www folder and also the --source-map advanced options is ignored, maps seems to not be created.

if we perform ionic build --prod --source-map the maps are created in the www folder.

if we perform ionic build --prod --source-map --engine=cordova --platform=android --release
a) the www folder is not cleaned
b) the source map files are not created
c) the cordova app is not created, it stops after building the www files

My ionic info:

Ionic:
   ionic (Ionic CLI)             : 4.10.3 (/usr/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.2
   @angular-devkit/build-angular : 0.12.4
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.2.4
   @ionic/angular-toolkit        : 1.4.0

Cordova:
   cordova (Cordova CLI) : 8.1.2 ([email protected])
   Cordova Platforms     : not available
   Cordova Plugins       : not available

System:
   Android SDK Tools : 26.1.1 (/home/michi/software/android/sdk)
   NodeJS            : v10.15.2 (/usr/bin/node)
   npm               : 6.8.0
   OS                : Linux 4.15
@mburger81
Copy link
Author

Hello @dwieeb, with [email protected] the --source-map issue is resolved but there is still the issue about the www folder which is not cleaned up on different commands.

@imhoffd
Copy link
Contributor

imhoffd commented Apr 17, 2019

Glad to hear --source-map is working.

We disable deleting the www before doing a build with --engine=cordova. By default, the Angular CLI does delete the output directory before building.

If we do delete the output directory with each build, the Cordova CLI will occasionally forcefully error out saying "This is not a Cordova project."

Perhaps a flag to force delete the output directory?

@mburger81
Copy link
Author

We did about 20 tests, we removed always the www folder before we created a cordova production build and had never a problem like described.

The problem is, if you don't polish www folder you can have several problems with wrong and unneeded files.
Our Android production build is about 7mb but if the www folder isn't deleted we run also in about 22mb bundles, for example when we did test for source maps.
I think this is a bad thing not deleting the folder and I'm honestly wondering why this is not well documented, or did I miss something?

Thx

@imhoffd
Copy link
Contributor

imhoffd commented Apr 19, 2019

@mburger81 Turning off output directory deletion was done here ionic-team/angular-toolkit#51. Admittedly I could never reproduce that issue. I just knew the change would resolve the issue.

There's also #3823 where not deleting it was causing issues for multi-app projects.

In any case, this needs more investigation. It's not good that artifacts from a dev build can end up in a prod build.

@imhoffd imhoffd added the bug label Apr 19, 2019
@ionitron-bot ionitron-bot bot removed the triage label Apr 19, 2019
@imhoffd
Copy link
Contributor

imhoffd commented Apr 25, 2019

@mburger81 Gonna close this in favor of a more specific issue: #3954

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants