Created
October 27, 2016 16:12
-
-
Save gon250/6ffa77433619a2f4be2f715fc60de452 to your computer and use it in GitHub Desktop.
Typescript + gulp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var browserify = require('browserify'); | |
var source = require('vinyl-source-stream'); | |
var tsify = require('tsify'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var buffer = require('vinyl-buffer'); | |
var paths = { | |
pages: ['src/*.html'] | |
}; | |
gulp.task('copyHtml', function () { | |
return gulp.src(paths.pages) | |
.pipe(gulp.dest('dist')); | |
}); | |
gulp.task('default', ['copyHtml'], function () { | |
return browserify({ | |
basedir: '.', | |
debug: true, | |
entries: ['src/main.ts'], | |
cache: {}, | |
packageCache: {} | |
}) | |
.plugin(tsify) | |
.transform('babelify', { | |
presets: ['es2015'], | |
extensions: ['.ts'] | |
}) | |
.bundle() | |
.pipe(source('bundle.js')) | |
.pipe(buffer()) | |
.pipe(sourcemaps.init({loadMaps: true})) | |
.pipe(sourcemaps.write('./')) | |
.pipe(gulp.dest('dist')); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "retail", | |
"version": "1.0.0", | |
"description": "RetailBanking app - public - Typescript", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"angular": "~1.2.27", | |
"angular-ui-router": "~0.2.13", | |
"bootstrap": "~3.3.4", | |
"jquery": "~1.11.2", | |
"nya-bootstrap-select": "~2.0.10", | |
"file-saver": "*", | |
"ui-router-extras": "~0.0.13" | |
}, | |
"devDependencies": { | |
"babel-preset-es2015": "^6.18.0", | |
"babelify": "^7.3.0", | |
"browserify": "^13.1.1", | |
"gulp": "^3.9.1", | |
"gulp-sourcemaps": "^2.2.0", | |
"gulp-typescript": "^3.0.2", | |
"gulp-uglify": "^2.0.0", | |
"gulp-util": "^3.0.7", | |
"tsify": "^2.0.2", | |
"typescript": "^2.0.6", | |
"vinyl-buffer": "^1.0.0", | |
"vinyl-source-stream": "^1.1.0", | |
"watchify": "^3.7.0" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"files": [ | |
"src/app.ts" | |
], | |
"compilerOptions": { | |
"noImplicitAny": true, | |
"target": "es2015" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment