-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
33 lines (27 loc) · 803 Bytes
/
gulpfile.js
File metadata and controls
33 lines (27 loc) · 803 Bytes
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
const { task, series, src, dest } = require('gulp');
const gulpClean = require('gulp-clean');
const rename = require('gulp-rename');
const svg2png = require('gulp-svg2png');
const { spawn } = require('child_process');
function clean() {
return src('build/**/*', { read: false }).pipe(gulpClean());
}
function buildReact() {
return spawn('npx', ['react-scripts', 'build'], { stdio: 'inherit', shell: true });
}
function buildIcon() {
return src('./graphics/logo_original.svg')
.pipe(
svg2png({
width: 512,
height: 512,
}),
)
.pipe(rename('icon.png'))
.pipe(dest('./build'));
}
task('clean', clean);
task('build:icon', buildIcon);
task('build:react', buildReact);
const build = series(buildReact, buildIcon);
exports.default = series(clean, build);