Ionic Pro: Customize scripts for Ionic Pro builds only


Is there any possibility to tell Ionic Pro that different scripts than npm install and npm run build should be executed?
We have some big dependencies defined (phantomjs, electron) that are listed in our optionalDependencies group.

I want to achieve that only when Ionic Pro is building the app, it’s executing npm install --no-optional - of course locally this should not be the case.

Another question: How can I, based on the desired channel, use the correct environment for building? So far we’ve had a npm run build:dev, npm run build:prod etc. This is now gone, since there is only one command that’s executed: npm run build.

To be honest: Ionic Pro is very frustrating, I don’t get the point why it’s needed to remove the control from the user. Besides that, the deployment via Git is very inconvenient, especially if the automatic deployment is already happening via a CI server.

Thanks in advance,


A post was split to a new topic: Ionic Pro: I am not happy with ionic pro

Yes, I agree.

I need to run my script (“npm run my-script some-parameter”) after “npm install” and before “npm run build”.

I’m looking for some way to do this and but apparently, it’s not possible.