Created
April 3, 2018 01:19
-
-
Save appellation/d84d906a8532715197252c7923fe49bc to your computer and use it in GitHub Desktop.
This file contains 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 del = require('del'); | |
const ts = require('gulp-typescript'); | |
const sourcemaps = require('gulp-sourcemaps'); | |
const typedoc = require('gulp-typedoc'); | |
const project = ts.createProject('tsconfig.json'); | |
gulp.task('default', ['build']); | |
gulp.task('build', () => { | |
del.sync(['dist/**', '!dist']); | |
del.sync(['typings/**', '!typings']); | |
const result = project.src() | |
.pipe(sourcemaps.init()) | |
.pipe(project()); | |
result.dts.pipe(gulp.dest('typings')); | |
result.js.pipe(sourcemaps.write('.', { sourceRoot: '../src' })).pipe(gulp.dest('dist')); | |
}); | |
gulp.task('docs', () => { | |
del.sync(['docs/**']); | |
return gulp.src(['src/*.ts']) | |
.pipe(typedoc({ | |
module: 'commonjs', | |
target: 'es2017', | |
out: './docs', | |
})); | |
}); |
This file contains 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
{ | |
"compilerOptions": { | |
"strict": true, | |
"module": "commonjs", | |
"moduleResolution": "node", | |
"target": "es2015", | |
"lib": [ | |
"es2017" | |
], | |
"declaration": true, | |
"sourceMap": true, | |
"removeComments": false | |
}, | |
"include": [ | |
"./src/" | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment