How to inject own process into ionic-app-scripts build


#1

I want to make preprocessing of source code before build. How can I do it? How to inject my own process into build process?

Thanks in advance!

BR,
Anatoly


#2

If your process has to do with the android or ios platform, I would use a cordova hook

If your process has to do with building your app, like css or webpack stuffs for example, you will have to overwrite locally one of the ionic app-scripts config (https://github.com/ionic-team/ionic-app-scripts/tree/master/config)


#3

@reedrichards thank you so much! Where should I put custom config files?


#4

where you want in your projecct

for cordova hook in the config.xml you gonna tell in the hook where the file is. like

<platform name="android">
     <hook src="scripts/my-cordova-android-prepare.js" type="after_prepare" />
</platform>

for overwriting app-scripts, you gonna specifiy it in your package.json, for example

"config": {
      "ionic_sass": "./scripts/sass.config.js",
 }