Skip to content

Instantly share code, notes, and snippets.

@yuka2py
Created March 26, 2015 06:19
Show Gist options
  • Save yuka2py/0108694eb877ca633c5a to your computer and use it in GitHub Desktop.
Save yuka2py/0108694eb877ca633c5a to your computer and use it in GitHub Desktop.
gulpfile for browserify + TypeScript + React.js with JSX
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var tsify = require('tsify');
var reactify = require('reactify');
gulp.task('browserify', function () {
return browserify({
entries: [App.Src + 'scripts/app.ts'],
transform: [reactify],
debug: App.DEBUG
})
.plugin(tsify, {
noImplicitAny: false, //trueが望ましいが、外部ライブラリがエラーを起こすため
module : 'commonjs',
target: 'ES5'
})
.bundle()
.pipe(plumber())
.pipe(source('application.js'))
.pipe(gulp.dest(App.Dest + 'scripts/'))
});
@yuka2py
Copy link
Author

yuka2py commented Mar 26, 2015

tsify でエラーがおきたら gulp watch が停止するんですが、どうしたもんか。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment