-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
36 lines (32 loc) · 1009 Bytes
/
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
const gulp = require('gulp');
const cp = require('child_process');
const browserSync = require('browser-sync').create();
gulp.task('compile-core', (done) => {
const outputFilePath = 'res/js/Draw2PNG/dist/Draw2PNG.min.js';
const folders = [
/**
* Order matters and is the same we follow in _index.html_:
*/
'res/js/Draw2PNG/src/functions/*.js',
'res/js/Draw2PNG/src/classes/*.js',
'res/js/Draw2PNG/src/Color.js',
'res/js/Draw2PNG/src/Pixmap.js',
'res/js/Draw2PNG/src/Filter.js',
'res/js/Draw2PNG/src/ColorToleranceFilter.js'
].join(' ');
cp.execSync(
'./node_modules/.bin/google-closure-compiler ' +
'--js ' + folders +
' --js_output_file ' + outputFilePath
);
done();
});
gulp.task('browser-sync', (done) => {
const port = 9999;
browserSync.init({
port : port,
server : {
baseDir : './'
}
});
});