-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
61 lines (47 loc) · 1.73 KB
/
Copy pathgulpfile.js
File metadata and controls
61 lines (47 loc) · 1.73 KB
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
56
57
58
59
60
61
'use strict';
const Promise = require('bluebird');
const gulp = require('gulp');
const _ = require('lodash');
const $ = require('gulp-load-plugins')();
const fs = Promise.promisifyAll(require('fs-extra'));
const opn = require('opn')
const runSequence = require('run-sequence');
const widgetConfig = require('./build/config/widget.config.json');
if (!_.has(gulp,'context')) {
gulp.context = {
widgetName: widgetConfig.widgetName
};
}
else {
console.error('Unexpected build failure. gulp already has a context.');
process.exit(1);
}
fs.readdirSync('./build/tasks').filter(function(file) {
return (/\.js$/i).test(file);
}).map(function(file) {
require(`./build/tasks/${file}`);
});
gulp.task('default', function () {
gulp.start('build');
});
// gulp.task('build', function(done) {
// //runSequence('clean', 'core', ['makeDocs', 'makeExample'], done);
// runSequence('clean', 'core', 'testSpecs', ['makeDocs', 'makeExample'], done);
// });
// gulp.task('build_s', function(done) {
// runSequence('clean', 'core', ['makeDocs', 'makeExample'], done);
// });
// gulp.task('core', ['compileES6ToInst', 'less', 'copy', 'buildContentManifest']);
// gulp.task('core', ['compileES6ToInst', 'less', 'copy', 'buildContentManifest']);
gulp.task('build', function(done) {
runSequence('clean', 'less', 'copy', 'buildContentManifest', ['makeDocs'], done);
});
gulp.task('serve', ['less', 'copy', 'buildContentManifest', 'connect', 'watch'], function () {
opn('http://localhost:9000');
});
gulp.task('serve_s', ['less', 'copy', 'buildContentManifest', 'connect_s'], function () {
opn('http://localhost:9000');
});
// gulp.task('serve', ['core', 'compileInternalWeb', 'connect', 'watch'], function () {
// opn('http://localhost:9000');
// });