-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update build environment and add git projects support
- Loading branch information
Showing
20 changed files
with
12,172 additions
and
3,300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const fs = require('fs'); | ||
const gulp = require('gulp'); | ||
const babel = require('gulp-babel'); | ||
const rename = require('gulp-rename'); | ||
const sourcemaps = require('gulp-sourcemaps'); | ||
const eslint = require('gulp-eslint'); | ||
|
||
let babelrc = JSON.parse(fs.readFileSync('.babelrc', 'utf8') || '{}'); | ||
|
||
function babelTask() { | ||
return gulp.src(['./**/*.js.flow', '!node_modules', '!node_modules/**']) | ||
.pipe(sourcemaps.init()) | ||
.pipe(babel(babelrc)) | ||
.pipe(rename(path => { | ||
// Fix file extension for double ext files (.js.flow) | ||
path.extname = path.basename.endsWith('.js') ? '' : '.js'; | ||
})) | ||
.pipe(sourcemaps.write('.')) | ||
.pipe(gulp.dest('.')); | ||
} | ||
|
||
function eslintTask() { | ||
return gulp.src(['./**/*.js.flow', './tests/*.js', '!node_modules', '!node_modules/**']) | ||
.pipe(eslint()) | ||
.pipe(eslint.format('node_modules/eslint-formatter-pretty')) | ||
.pipe(eslint.failAfterError()); | ||
} | ||
|
||
function watchTask() { | ||
gulp.watch(['./**/*.js.flow', '!node_modules', '!node_modules/**'], babelTask); | ||
} | ||
|
||
gulp.task('babel', babelTask); | ||
gulp.task('eslint', eslintTask); | ||
gulp.task('default', gulp.series('eslint', 'babel')); | ||
gulp.task('watch', gulp.series('default', watchTask)); |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.