I would like the TypeScript Compiler to use node_modules/firebase/firebase.d.ts
to typecheck my code and also bundle node_modules/firebase/firebase.js
tsc
is a compiler, not a bundler. This question expounds on bundling a bit.
While developing in TypeScript, gulp + gulp-browserify can provide a watcher and bundler.
With "module": "umd"
in the compiler options, this gulpfile.js
will do the rest:
var gulp = require('gulp');
var ts = require('gulp-typescript');
var browserify = require('gulp-browserify');
gulp.task('default', function () {
return gulp.src('src/*.ts')
.pipe(ts.createProject('tsconfig.json')())
.pipe(browserify())
.pipe(gulp.dest('dist/gen'));
});
gulp.task('watch', ['default'], function () {
gulp.watch('src/*.ts', ['default']);
});