forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
70 lines (56 loc) · 1.52 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
62
63
64
65
66
67
68
69
70
const gulp = require('gulp');
const _rimraf = require('rimraf');
function rimraf(dir) {
let retries = 0;
const retry = cb => {
_rimraf(dir, { maxBusyTries: 1 }, err => {
if (!err) {
return cb();
}
if (err.code === 'ENOTEMPTY' && ++retries < 5) {
return setTimeout(() => retry(cb), 10);
}
return cb(err);
});
};
return cb => retry(cb);
}
gulp.task('app', () =>
gulp.src('packages/app/www/**/*').pipe(gulp.dest('www'))
);
gulp.task('homepage', () =>
gulp.src('packages/homepage/public/**/*').pipe(gulp.dest('www'))
);
gulp.task('monaco', () =>
gulp
.src('standalone-packages/monaco-editor/release/min/vs/**/*')
.pipe(gulp.dest('www/public/14/vs'))
);
// Used for cases where HTML is cached
gulp.task('old-browserfs', () =>
gulp
.src('standalone-packages/codesandbox-browserfs/dist/**/*')
.pipe(gulp.dest('www/static/browserfs2'))
);
gulp.task('old-vscode', () =>
gulp
.src('standalone-packages/vscode-editor/release/min/vs/**/*')
.pipe(gulp.dest('www/public/vscode8/vs'))
);
gulp.task('statics', () =>
gulp.src('packages/app/public/**/*').pipe(gulp.dest('www'))
);
gulp.task('default', [
'app',
'homepage',
'statics',
'monaco',
'old-browserfs',
'old-vscode',
]);
gulp.task('clean-vscode', rimraf('standalone-packages/monaco-editor-core'));
gulp.task('prepare-vscode', ['clean-vscode'], () =>
gulp
.src('standalone-packages/vscode/out-monaco-editor-core/**/*')
.pipe(gulp.dest('standalone-packages/monaco-editor-core'))
);