-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgulpfile.js
40 lines (35 loc) · 959 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
37
38
39
40
var gulp = require('gulp');
var nodemon = require('gulp-nodemon');
const eslint = require('gulp-eslint');
gulp.task('start', function() {
nodemon({
script: 'app.js',
ext: 'js html',
env: { NODE_ENV: 'development', NETWORK_ID: 3 }
});
});
gulp.task('start:local', function() {
nodemon({
script: 'app.js',
ext: 'js html',
env: { NODE_ENV: 'e3', WEB3_PROVIDER: 'http://localhost:8545', WEB3_WS_PROVIDER: 'ws://localhost:8545', NETWORK_ID: 101 }
});
});
gulp.task('lint', () => {
return gulp
.src(['**/*.js', '!node_modules/**'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
function isFixed(file) {
return file.eslint && typeof file.eslint.output === 'string';
}
gulp.task('lint:fix', () => {
return gulp
.src(['**/*.js', '!node_modules/**'])
.pipe(eslint({ fix: true }))
.pipe(eslint.format())
.pipe(gulp.dest('.'))
.pipe(eslint.failAfterError());
});