-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gulpfile.js
25 lines (20 loc) · 844 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
const gulp = require('gulp');
const webpack = require('webpack-stream');
const gulpScreeps = require('gulp-screeps');
const insert = require('gulp-insert');
const eslint = require('gulp-eslint');
const paths = {
src: 'src/**/*.js'
};
gulp.task('default', ['lint', 'commit']);
gulp.task('commit', () =>
gulp.src('src/main.js')
.pipe(webpack({ output: { filename: "main.js" } }))
.pipe(insert.prepend("module.exports = ")) // This line makes webpack's boilerplate be compatible with Screeps.
.pipe(gulpScreeps(Object.assign({}, require('./credentials.json'), {branch: process.env['TRAVIS_BRANCH']}))));
gulp.task('lint', () =>
gulp.src(paths.src)
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError()));
gulp.task('watch', () => gulp.watch(paths.src, ['default']));