@@ -3,7 +3,8 @@ const gulp = require('gulp'),
33 $ = require ( 'gulp-load-plugins' ) ( ) ,
44 path = require ( 'path' ) ,
55 del = require ( 'del' ) ,
6- inquirer = require ( 'inquirer' ) ;
6+ inquirer = require ( 'inquirer' ) ,
7+ merge = require ( 'merge2' ) ,
78 ts = require ( 'gulp-typescript' ) ,
89 tsProject = ts . createProject ( 'tsconfig.json' ) ;
910
@@ -47,25 +48,31 @@ async function scripts () {
4748 return path . basename ( file , path . extname ( file ) ) ;
4849 } ) . join ( ',' )
4950
50- return tsProject . src ( )
51- . pipe ( tsProject ( ) )
52- . js
53- // TODO: Do tslint
54- // .pipe($.jshint())
55- // .pipe($.jshint.reporter('jshint-stylish'))
56- . pipe ( $ . insert . prepend ( '/*! ' + pkg . name + ' - v' + pkg . version + ' - \n' +
57- ' * Copyright (c) Hassan Khan ' + new Date ( ) . getFullYear ( ) + '\n' +
58- ' */' ) )
59- . pipe ( $ . uglify ( {
60- output : {
61- comments : / # # E M O J I L I S T /
62- }
63- } ) )
64- . pipe ( $ . rename ( {
65- suffix : '.min'
66- } ) )
67- . pipe ( $ . replace ( / ( \/ \* # # E M O J I L I S T \* \/ .+ ?) , / , `/*##EMOJILIST*/"${ emojiString } ",` ) )
68- . pipe ( gulp . dest ( paths . dist . scripts ) ) ;
51+ const tsResult = tsProject . src ( ) . pipe ( tsProject ( ) )
52+
53+ return merge ( [
54+ tsResult
55+ . js
56+ // TODO: Do tslint
57+ // .pipe($.jshint())
58+ // .pipe($.jshint.reporter('jshint-stylish'))
59+ . pipe ( $ . insert . prepend ( `/*! ${ pkg . name } - v${ pkg . version } -
60+ * Copyright (c) Yukai Huang ${ new Date ( ) . getFullYear ( ) }
61+ */` ) )
62+ . pipe ( $ . uglify ( {
63+ output : {
64+ comments : / # # E M O J I L I S T /
65+ }
66+ } ) )
67+ . pipe ( $ . rename ( {
68+ suffix : '.min'
69+ } ) )
70+ . pipe ( $ . replace ( / ( \/ \* # # E M O J I L I S T \* \/ .+ ?) , / , `/*##EMOJILIST*/"${ emojiString } ",` ) )
71+ . pipe ( gulp . dest ( paths . dist . scripts ) ) ,
72+ tsResult
73+ . dts
74+ . pipe ( gulp . dest ( paths . dist . root ) )
75+ ] )
6976}
7077exports . scripts = scripts
7178
0 commit comments