microsoft/vscode-react-native
Publicmirrored from https://github.com/microsoft/vscode-react-nativeAvailable
gulp_scripts/watcher.js
22lines · modeblame
c29f0740benjaminbi3 years ago | 1 | const gulp = require("gulp"); |
| 2 | const { series } = require("gulp"); | |
| 3 | const log = require("fancy-log"); | |
| 4 | const getBuilder = require("../gulp_scripts/builder"); | |
| 5 | const getTester = require("../gulp_scripts/tester"); | |
| 6 | const srcPath = "src"; | |
| 7 | const testPath = "test"; | |
| 8 | const sources = [srcPath, testPath].map(tsFolder => tsFolder + "/**/*.ts"); | |
| 9 | | |
| 10 | const watch = series(getBuilder.buildTask, function runWatch() { | |
| 11 | log("Watching build sources..."); | |
| 12 | return gulp.watch(sources, gulp.series(getBuilder.buildTask)); | |
| 13 | }); | |
| 14 | | |
| 15 | const watchBuildTest = gulp.series(getBuilder.buildTask, getTester.testTask, function runWatch() { | |
| 16 | return gulp.watch(sources, gulp.series(getBuilder.buildTask, getTester.testTask)); | |
| 17 | }); | |
| 18 | | |
| 19 | module.exports = { | |
| 20 | watch, | |
| 21 | watchBuildTest, | |
b41ed829benjaminbi3 years ago | 22 | }; |