-
Notifications
You must be signed in to change notification settings - Fork 6
/
gulpfile.js
61 lines (56 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
var gulp = require('gulp');
var lasso = require('gulp-lasso');
var babel = require('gulp-babel');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var cleanCss = require('gulp-clean-css');
gulp.task('buildTestPage', function () {
gulp.src('./test/*.html')
.pipe(
lasso({
'configFile': './lasso-config.json',
'dependencies': [
'./src/minimap.css',
'require-run: ./test/main.js'
]
})
)
.pipe(gulp.dest('test-out'));
});
gulp.task('build', function () {
// minified js
gulp.src('src/minimap.js')
.pipe(
lasso({
'configFile': './lasso-config.json'
})
)
.pipe(
babel({
presets: ['es2015']
}))
.pipe(uglify())
.pipe(rename('minimap.min.js'))
.pipe(gulp.dest('dist'));
// non-minified js
gulp.src('src/minimap.js')
.pipe(
lasso({
'configFile': './lasso-config.json'
})
)
.pipe(
babel({
presets: ['es2015']
})
)
.pipe(gulp.dest('dist'));
// minified css
gulp.src('src/minimap.css')
.pipe(cleanCss())
.pipe(rename('minimap.min.css'))
.pipe(gulp.dest('dist'));
// non-minified css
gulp.src('src/minimap.css')
.pipe(gulp.dest('dist'));
});