-
Notifications
You must be signed in to change notification settings - Fork 20
/
gulpfile.js
48 lines (44 loc) · 1.33 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
const gulp = require('gulp');
const del = require('del');
const babel = require('gulp-babel');
const strip = require('gulp-strip-comments');
gulp.task('build', ['clean'], () => {
// Babel
gulp.src('src/module.js')
.pipe(babel())
.pipe(strip())
.pipe(gulp.dest('dist'));
// Cesium, copy it from the npm install directory
gulp.src('node_modules/cesium/Build/Cesium/Cesium.js')
.pipe(gulp.dest('dist/Cesium'));
gulp.src('node_modules/cesium/Build/Cesium/Workers/**/*')
.pipe(gulp.dest('dist/Cesium/Workers'));
gulp.src('node_modules/cesium/Build/Cesium/Widgets/**/*')
.pipe(gulp.dest('dist/Cesium/Widgets'));
gulp.src('node_modules/cesium/Build/Cesium/Assets/**/*')
.pipe(gulp.dest('dist/Cesium/Assets'));
// plugin.json
gulp.src('plugin.json')
.pipe(gulp.dest('dist'));
// README.md
gulp.src('src/README.md')
.pipe(gulp.dest('dist'));
// HTML
gulp.src('src/**/*.html')
.pipe(gulp.dest('dist'));
// CSS
gulp.src('src/css/**/*')
.pipe(gulp.dest('dist/css'));
// Images
gulp.src('src/img/**/*')
.pipe(gulp.dest('dist/img'));
});
// Delete the dist directory
gulp.task('clean', () => (del(['dist'])));
// Rerun the task when a file changes
gulp.task('watch', () => {
gulp.watch([
'src/**/*',
], ['build']);
});
gulp.task('default', ['watch', 'build']);