Working on a project and I've decided to use gulp for Typescript watching and transpiling.
Here are the steps I took to install everything.
All this is done within the root directory of my project:
$ sudo npm update
$ npm -v #1.3.10
$ npm init #to create the package.json
$ sudo npm install gulp -g #installing gulp globally
$ gulp -v # No version number is shown.. why?
$ npm install gulp --save-dev
$ npm install gulp-typescript
$ vim gulpfile.js
Here are the contents of my gulpfile.js:
var gulp = require('gulp');
var ts = require('gulp-typescript');
var tsProject = ts.createProject({
declaration: true,
noExternalResolve: true
});
gulp.task('scripts', function() {
return gulp.src('web/ts/*.ts')
.pipe(ts(tsProject))
.pipe(gulp.dest('web/js'))
});
gulp.task('watch', ['scripts'], function() {
gulp.watch('web/ts/*.ts', ['scripts']);
});
However, I get nothing when I run $ gulp scripts
. No error. What am I doing wrong?