Skip to content
This repository has been archived by the owner on Nov 19, 2019. It is now read-only.

Fix build scripts #178

Merged
merged 1 commit into from
Jul 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 2 additions & 20 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,29 +148,12 @@ function minifyJs(cb) {
fs.writeFileSync(DIST + '/' + TIMELINE_MAP, result.map.replace(/"\.\/dist\//g, '"'));

cb();
});
}

function typings() {
return src('./index.d.ts')
.pipe(rename(TIMELINE_D_TS))
.pipe(dest(DIST));
});

gulp.task('bundle', ['bundle-js', 'bundle-css']);

// read command line arguments --bundle and --minify
var bundle = 'bundle' in argv;
var minify = 'minify' in argv;
var watchTasks = [];
if (bundle || minify) {
// do bundling and/or minifying only when specified on the command line
watchTasks = [];
if (bundle) watchTasks.push('bundle');
if (minify) watchTasks.push('minify');
}
else {
// by default, do both bundling and minifying
watchTasks = ['bundle', 'minify'];
}

// The watch task (to automatically rebuild when the source code changes)
Expand All @@ -185,7 +168,6 @@ function watchFiles() {
}
}


// linting task
function lint(cb) {
return src(['lib/**/*.js', '!node_modules/**'])
Expand All @@ -206,5 +188,5 @@ exports.clean = clean;
exports.build = bundle;
exports.watch = watchFiles;
exports.lint = lint;
exports.typing = typing;
exports.typing = typings;
exports.default = series(clean, lint, bundle, typings);
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,5 @@
"uuid": "^3.1.0",
"webpack": "^3.3.0",
"yargs": "^8.0.2"
},
"scripts" : {
"test" : "testcafe chrome tests/UI/"
}
}