Ionic and TypeScript: Part 1
With so much focus on moving code towards ES6 and making it future-proof, I wanted to show you how you can start adopting tools like TypeScript to create an app that can be easily upgraded and maintained.
$ npm install gulp-tsc --save-dev
Here’s the Gulp build task for TypeScript:
var typescript = require('gulp-tsc');
var paths = {
sass: ['./scss/**/*.scss'],
src: ['./src/*.ts']
};
gulp.task('compile', function(){
gulp.src(paths.src)
.pipe(typescript({
emitError: false
))
.pipe(gulp.dest('www/js/'))
})
In my next post, I’ll go over how to use the static typings in TypeScript to annotate your code.