Created
October 5, 2015 20:45
-
-
Save jamiebuilds/9fd93d3893e2cbd78329 to your computer and use it in GitHub Desktop.
Example multi-file gulp setup
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
export lint from './task-lint'; | |
export test from './task-test'; | |
export build from './task-build'; | |
export dev from './task-dev'; | |
export default dev; |
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
import {src, dest, series} from 'gulp'; | |
import buildPlugin from 'gulp-build-plugin'; | |
import {SRC_DIRECTORY, DIST_DIRECTORY} from './task-constants'; | |
import test from './task-test'; | |
const buildFiles = () => src(SRC_DIRECTORY) | |
.pipe(buildPlugin()) | |
.pipe(dest(DIST_DIRECTORY)); | |
export default series(test, buildFiles); |
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
export const SRC_DIRECTORY = './src'; | |
export const TEST_DIRECTORY = './test'; | |
export const DIST_DIRECTORY = './dist'; |
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
import {watch, parallel} from 'gulp'; | |
import {SRC_DIRECTORY, TEST_DIRECTORY} from './task-constants'; | |
import test from './task-test'; | |
import build from './task-build'; | |
export default () => { | |
watch(SRC_DIRECTORY, parallel(test, build)); | |
watch(TEST_DIRECTORY, test); | |
}; |
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
import {src, parallel} from 'gulp'; | |
import lintPlugin from 'gulp-lint-plugin'; | |
import {SRC_DIRECTORY, TEST_DIRECTORY} from './task-constants'; | |
const lintDir = dir => src(dir) | |
.pipe(lintPlugin()); | |
const lintSrc = () => lintDir(SRC_DIRECTORY); | |
const lintTest = () => lintDir(TEST_DIRECTORY); | |
const lintFiles = parallel(lintSrc, lintTest); | |
export const reportLint = () => lintPlugin.report(); | |
export default series(lintFiles, reportLint); |
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
import {src, parallel, series} from 'gulp'; | |
import testPlugin from 'gulp-test-plugin'; | |
import {TEST_DIRECTORY} from './task-constants'; | |
import {reportLint}, lint from './task-lint'; | |
const testFiles = () => src(TEST_DIRECTORY) | |
.pipe(testPlugin()); | |
const reportTest = () => testPlugin.report(); | |
const reportLintAndTest = series(reportLint, reportTest); | |
export default series(parallel(lint, testFiles), reportLintAnTest); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment