Skip to content

Instantly share code, notes, and snippets.

@ratbeard
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save ratbeard/9119040 to your computer and use it in GitHub Desktop.

Select an option

Save ratbeard/9119040 to your computer and use it in GitHub Desktop.
gulp if issue
src("coffee")
# For source maps we also need to move the coffee files into build
.pipe(gulpif(isDev, dest("build.coffee")))
.pipe(plumber())
.pipe(print())
.pipe(logErrors(coffee(sourceMap: isDev)))
.pipe(dest("build.coffee"))
# When isDev is true, only .coffee files ends up in build dir, no .js or .map files.
# print() prints out no files, its as if the pipeline chain halts
# If I remove the gulpif, I get all 3 file types as desired.
# But I'd like to use gulpif to not get .map and .coffee files when I'm not in dev
src("coffee")
# For source maps we also need to move the coffee files into build
.pipe(dest("build.coffee"))
.pipe(plumber())
.pipe(print())
.pipe(logErrors(coffee(sourceMap: isDev)))
.pipe(dest("build.coffee"))
.pipe(dest("build.coffee"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment