I develop an app with Ionic 2 and TypeScript that relies heavily on Redux (ng2Redux: https://github.com/wbuchwalter/ng2-redux).
Instead of redux-thunk I use redux-saga as middleware, which works really great together with ng2/Ionic 2!
redux-saga is used with generator functions (function*…). TypeScript only supports them when targetting ES6 in tsconfig.json. It won’t compile otherwise. So far, so good, a “ionic serve” just works, as the resulting app.bundle.js in ES6 is handled just fine by the Chrome browser.
But on mobile devices, you cannot rely on ES6 supported by the webview of the target device. That’s no option for most devices out there at the moment. So I guess I have to “babelify” the built bundle down to ES5, enriched with the corresponding babel plugin to support generator functions (eventually babel-plugin-regenerator).
Is there a convenient way to achieve this with the current state of Ionic CLI V2? I’m a bit puzzled where to hook the babel step. Or will I have to wait until the CLI fully supports Gulp, where it would be easier to add the babel step?