forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
70 lines (56 loc) · 1.51 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/13/vs'))
);
// Used for cases where HTML is cached
gulp.task('old-browserfs', () =>
gulp
.src('standalone-packages/codesandbox-browserfs/dist/**/*')
.pipe(gulp.dest('www/static/browserfs'))
);
gulp.task('old-vscode', () =>
gulp
.src('standalone-packages/vscode-editor/release/min/vs/**/*')
.pipe(gulp.dest('public/vscode2/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'))
);