-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
31 lines (22 loc) · 984 Bytes
/
Copy pathgulpfile.js
File metadata and controls
31 lines (22 loc) · 984 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
const path = require('path');
const { task, src, dest, parallel } = require('gulp');
task('build:icons', copyIcons);
task('build:js', copyJavaScript);
task('build:all', parallel('build:icons', 'build:js'));
function copyIcons() {
const nodeSource = path.resolve('nodes', '**', '*.{png,svg}');
const nodeDestination = path.resolve('dist', 'nodes');
src(nodeSource).pipe(dest(nodeDestination));
const credSource = path.resolve('credentials', '**', '*.{png,svg}');
const credDestination = path.resolve('dist', 'credentials');
const iconsSource = path.resolve('icons', '*.{png,svg}');
const iconsDestination = path.resolve('dist', 'icons');
src(iconsSource).pipe(dest(iconsDestination));
return src(credSource).pipe(dest(credDestination));
}
function copyJavaScript() {
// Copy the main index.js file to dist
const indexJsSource = path.resolve('index.js');
const indexJsDestination = path.resolve('dist');
return src(indexJsSource).pipe(dest(indexJsDestination));
}