Skip to content

Instantly share code, notes, and snippets.

@hiroaki-yamamoto
Created October 17, 2016 09:32
Show Gist options
  • Save hiroaki-yamamoto/daf3328308f121ee1f3e1a0950511221 to your computer and use it in GitHub Desktop.
Save hiroaki-yamamoto/daf3328308f121ee1f3e1a0950511221 to your computer and use it in GitHub Desktop.
I wanna do somethig
g.task "third_party", ->
prefix = "app/home/static/third_party"
files = [
"#{prefix}/angular/angular.js"
"#{prefix}/angular-animate/angular-animate.js"
"#{prefix}/angular-aria/angular-aria.js"
"#{prefix}/angular-messages/angular-messages.js"
"#{prefix}/angular-resource/angular-resource.js"
"#{prefix}/angular-material/angular-material.js"
]
if not toolbox.isProduction or process.env.node_mode is "init"
files.splice 2, 0, "#{prefix}/angular-mocks/angular-mocks.js"
files.push "#{prefix}/angular-material/angular-material-mocks.js"
pipe = g.src(files).pipe(
plumber "errorHandler": notify.onError '<%= error.message %>'
)
if not toolbox.isProduction or process.env.node_mode is "init"
pipe = pipe.pipe(sourcemaps.init())
pipe = pipe.pipe concat("third_party.js")
if toolbox.isProduction
pipe = pipe.pipe(uglify())
if not toolbox.isProduction or process.env.node_mode is "init"
pipe = pipe.pipe(sourcemaps.write())
pipe.pipe g.dest "app/home/static"
@hiroaki-yamamoto
Copy link
Author

I think this code has too much if...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment