Angular 4/Ionic3 production build changes components classname


#1

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?


#2

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


#3

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


#4

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.