-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
44 lines (38 loc) · 1.18 KB
/
gulpfile.js
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
var gulp = require('gulp');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var fs = require('fs');
var json = JSON.parse(fs.readFileSync('./package.json'));
var jsFiles = ["src/container.js",
"src/dictionary.js",
"src/painter.js",
"src/tools.js",
"src/commands.js",
"src/actions.js",
"src/widgets.js",
"src/lz-string.js"];
var jsDest = "dist";
var cssFiles = ["src/neo.css"]
var name = json.name + "-" + json.version;
var jsBuild = function() {
return gulp.src(jsFiles)
.pipe(concat('sneo.js'))
.pipe(gulp.dest(jsDest))
.pipe(rename(name + '.js'))
.pipe(gulp.dest(jsDest));
};
var cssBuild = function() {
return gulp.src(cssFiles)
.pipe(concat('sneo.css'))
.pipe(gulp.dest(jsDest))
.pipe(rename(name + '.css'))
.pipe(gulp.dest(jsDest));
};
gulp.task('scripts', jsBuild);
gulp.task('scripts2', cssBuild);
gulp.task('default', function() {
jsBuild();
cssBuild();
gulp.watch(jsFiles, gulp.series('scripts'));
gulp.watch(cssFiles, gulp.series('scripts2'));
});