TypeStrong / tsify

Browserify plugin for compiling TypeScript
344 stars 75 forks source link

ts files not showing up in output #242

Closed erikmellum closed 6 years ago

erikmellum commented 6 years ago

My ts files aren't showing up in my output bundle. I'm wondering if I am missing .add somewhere perhaps?

const customOpts = {
    debug: true,
  };
  return browserify(customOpts)
    .plugin(tsify, { target: 'es6', project: 'assets/js/tsconfig.json'  })
    .transform(babelify, { extensions: ['.tsx', '.ts' ]})
// Do I need to run .add here or something?
    .bundle()
    .pipe(source('app.js'))
    .pipe(buffer())
    .pipe(uglify())
    .pipe(rev())
    .pipe(gulp.dest(destPath))
    .on('finish', () => {
      gutil.log('Completed JS build.');
    });
cartant commented 6 years ago

Yes. As with a JavaScript app, Browserify needs to know the entry point file. Browserify basically drives the process, so you need an add or need to specify the entry point file in its configuration options.

See https://github.com/TypeStrong/tsify/blob/master/examples/greeter/build.js