Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit 2fcf251

Browse files
author
Alexey Reznichenko
committed
A few cosmetic improvements before merging #52
Ignore all auto-generated js/ts sources. Add 'bundle' gulp task to generate a single js file (used by Sample.html).
1 parent 606a619 commit 2fcf251

File tree

6 files changed

+1785
-47
lines changed

6 files changed

+1785
-47
lines changed

gulpfile.js

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ var minify = require('gulp-minify');
66
var git = require('gulp-git');
77
var versionBump = require('gulp-bump')
88
var tagVersion = require('gulp-tag-version');
9+
var webpack = require('webpack-stream');
910

1011
gulp.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: /\.js$/,
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.
3753
gulp.task('patchRelease', ['build'], function() { return BumpVersionTagAndCommit('patch'); })
3854
gulp.task('featureRelease', ['build'], function() { return BumpVersionTagAndCommit('minor'); })
3955
gulp.task('majorRelease', ['build'], function() { return BumpVersionTagAndCommit('major'); })
4056
gulp.task('preRelease', ['build'], function() { return BumpVersionTagAndCommit('prerelease'); })
4157

4258
function 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

Comments
 (0)