Created
December 26, 2018 07:55
-
-
Save knrt10/c0662c9c750bc409ea9924b841bf87a6 to your computer and use it in GitHub Desktop.
Gulpfile for minifying code from TS to JS
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
| const gulp = require("gulp"); | |
| const ts = require("gulp-typescript"); | |
| const sourcemaps = require("gulp-sourcemaps"); | |
| const tsProject = ts.createProject("tsconfig.json", { | |
| typescript: require("typescript") | |
| }); | |
| gulp.task("build", () => { | |
| gulp.src("process.yml") | |
| .pipe(gulp.dest("dist")); | |
| return tsProject.src() | |
| .pipe(sourcemaps.init()) | |
| .pipe(tsProject()) | |
| .js | |
| .pipe(sourcemaps.write()) | |
| .pipe(gulp.dest("dist")); | |
| }); | |
| gulp.task("watchTask", function () { | |
| gulp.watch("src/**/*.ts", ["build"]); | |
| }); | |
| gulp.task("default", gulp.series("build")); | |
| gulp.task("watch", gulp.series("build", "watchTask")); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment