Ionic task automation is based on Ionic App Scripts. Scripts are configured in your project’s package.json file.
If you want a .ts file to be included (e.g., “src/**/*.ts” as per the default tsconfig.json) in your build, place it in your project’s /src folder and it will be included in the generated /www/build/main.js.
BTW, ToastController and LoadingController are components not (Cordova) plugins.