@@ -6,14 +6,13 @@ var minify = require('gulp-minify');
66var git = require ( 'gulp-git' ) ;
77var versionBump = require ( 'gulp-bump' )
88var tagVersion = require ( 'gulp-tag-version' ) ;
9+ var webpack = require ( 'webpack-stream' ) ;
910
1011gulp . task ( "build" , function ( ) {
1112 return gulp . src ( [
12- "src/common/**/*.ts" ,
13- "src/common.browser/**/*.ts" ,
14- "src/sdk/speech/**/*.ts" ,
15- "src/sdk/speech.browser/**/*.ts" ,
16- "Speech.Browser.Sdk.ts" ] )
13+ "src/**/*.ts" ,
14+ "Speech.Browser.Sdk.ts" ] ,
15+ { base : '.' } )
1716 . pipe ( tslint ( {
1817 formatter : "prose" ,
1918 configuration : "tslint.json"
@@ -26,22 +25,39 @@ gulp.task("build", function() {
2625 target : "ES5" ,
2726 declaration : true ,
2827 noImplicitAny : true ,
29- removeComments : true
28+ removeComments : true ,
29+ outDir : 'distrib'
3030 } ) )
31- . pipe ( sourcemaps . write ( "." ) )
32- . pipe ( minify ( ) )
31+ . pipe ( sourcemaps . write ( '.' ) )
3332 . pipe ( gulp . dest ( 'distrib' ) ) ;
3433} ) ;
3534
36- // We dont want to release anything without successful build. So build task is dependency for these tasks.
35+ gulp . task ( "bundle" , [ "build" ] , function ( ) {
36+ return gulp . src ( 'samples/browser/sample_app.js' )
37+ . pipe ( webpack ( {
38+ output : { filename : 'speech.sdk.bundle.js' } ,
39+ devtool : 'source-map' ,
40+ module : {
41+ rules : [ {
42+ enforce : 'pre' ,
43+ test : / \. j s $ / ,
44+ loader : "source-map-loader"
45+ } ]
46+ }
47+ } ) )
48+ . pipe ( gulp . dest ( 'distrib' ) ) ;
49+ } ) ;
50+
51+
52+ // We don't want to release anything without a successful build. So build task is dependency for these tasks.
3753gulp . task ( 'patchRelease' , [ 'build' ] , function ( ) { return BumpVersionTagAndCommit ( 'patch' ) ; } )
3854gulp . task ( 'featureRelease' , [ 'build' ] , function ( ) { return BumpVersionTagAndCommit ( 'minor' ) ; } )
3955gulp . task ( 'majorRelease' , [ 'build' ] , function ( ) { return BumpVersionTagAndCommit ( 'major' ) ; } )
4056gulp . task ( 'preRelease' , [ 'build' ] , function ( ) { return BumpVersionTagAndCommit ( 'prerelease' ) ; } )
4157
4258function BumpVersionTagAndCommit ( versionType ) {
4359 return gulp . src ( [ './package.json' ] )
44- // bump the version numbr
60+ // bump the version number
4561 . pipe ( versionBump ( { type :versionType } ) )
4662 // save it back to filesystem
4763 . pipe ( gulp . dest ( './' ) )
0 commit comments