Angular 4/Ionic3 production build changes components classname

When running a production build of my app I noticed that the classes names changed. For example, a page component called “Search” changed to “t”. This breaks my app because I need to identify the component by It’s name in some place.

How could I retrieve the real name of the classes?

By running a version compiled with ionic serve. The --prod flag runs uglifyjs, which makes your code harder to read on purpose.

1 Like

I ran into a similar problem, in the end I decided to redesign the app arhitecture for a better solution.

1 Like

I ran into a similar problem, in the end I decided to redesign the app arhitecture for a better solution.

kgaspar, me too. Anyway it keeps as an advice for developers. Don’t use the class name because it will break your app in production mode.

3 Likes