-
Notifications
You must be signed in to change notification settings - Fork 34
/
gulpfile.js
55 lines (48 loc) · 1.46 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
var gulp = require( 'gulp' );
var ts = require( 'gulp-tsc' );
var connect = require( 'gulp-connect' );
var shell = require( 'gulp-shell' );
var uglify = require('gulp-uglify' );
var rename = require( 'gulp-rename' );
var typedoc = require("gulp-typedoc");
// 1541 - Claude Garamond was commissioned to create fonts for King Francis I
// of France and established himself as the first type designer.
gulp.task( 'compile' , function(){
return gulp.src( [ './src/txt/build.d.ts' ] )
.pipe( ts( {
target: 'ES5',
out: 'txt.js',
outDir: './dist',
emitError: true,
declaration: true,
removeComments: true
} ) )
.pipe( gulp.dest( './dist' ) );
});
gulp.task( 'build' , [ 'compile' ] , function() {
gulp.src( ['./dist/txt.js'] )
.pipe( uglify() )
.pipe( rename({ suffix: '.min' } ) )
.pipe( gulp.dest( './dist/' ) )
});
gulp.task( 'server' , [ 'build' ] , function () {
connect.server({
port: 1541,
livereload: false
})
});
gulp.task( 'browser' , [ 'server' ] , shell.task( [
/^win/.test( require( 'os' ).platform() ) ? 'start http://localhost:1541/' : 'open http://localhost:1541/'
] ) );
gulp.task("docs", function() {
return gulp
.src(["src/**/*.ts"])
.pipe(typedoc({
module: "commonjs",
target: "es5",
out: "docs/",
name: "txtjs"
}))
;
});
gulp.task( 'default' , [ 'browser' ] );