Skip to content

Instantly share code, notes, and snippets.

@glenux
Created May 17, 2019 13:15
Show Gist options
  • Save glenux/c5abaacefd9e8566f63436fd330b54c1 to your computer and use it in GitHub Desktop.
Save glenux/c5abaacefd9e8566f63436fd330b54c1 to your computer and use it in GitHub Desktop.
var gulp = require('gulp');
var ts = require('gulp-typescript');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var tsify = require('tsify');
/* for NODE */
/* gulp.task('default', function() {
return gulp.src('src/*.ts')
.pipe(ts({
experimentalDecorators: true,
noImplicitAny: true,
// outFile: 'main.js'
}))
.pipe(gulp.dest('dist'));
}); */
gulp.task('html', function() {
return gulp
.src('src/*.html')
.pipe(gulp.dest('dist'));
});
/* for BROWSER */
gulp.task('default', ["html"], function() {
return browserify({
basedir: '.',
debug: true,
entries: ['src/main.ts'],
cache: {},
packageCache: {}
})
.plugin(tsify)
.bundle()
.pipe(source('bundle.js'))
.pipe(gulp.dest("dist"));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment