     .pipe gulp.dest (file) -> file.base
 
 gulp.task 'cdnize-elements', ->
-  # azure version: https://projectyorucdn.blob.core.windows.net/project-yoru-cdn/
+  switch options.cdn
+    when 'wcdn'
+      cdn_prefix = "https://cdn.wcdn.io/"
+    when 'azure'
+      cdn_prefix = "https://projectyorucdn.blob.core.windows.net/project-yoru-cdn/"
+    when 'polygit'
+      cdn_prefix = "https://polygit.org/components/"
 
   gulp
     .src paths.elements.internal.pages.compiled
     .pipe $.debug()
     # TODO PreloadJS on jsdelivr is still v0.3, the one on cdnjs is still v0.6.0, while the latest is v0.6.2
     .pipe $.replace "../../bower_components/PreloadJS/lib/preloadjs-0.6.2.combined.js", "https://cdnjs.cloudflare.com/ajax/libs/PreloadJS/0.6.0/preloadjs.min.js"
-    .pipe $.replace "../../bower_components/", "http://cdn.wcdn.io/" # TODO https after wcdn supports https
-    # TODO polygit response with 400 for iron-ajax only
-    # TODO switch back to polygit until this got resolved: https://github.com/PolymerLabs/polygit/issues/6
-    # .pipe $.replace "../../bower_components/", "https://polygit.org/components/"
-    # the same place
-    .pipe gulp.dest (file) -> file.base
+    .pipe $.replace "../../bower_components/", cdn_prefix
+    .pipe gulp.dest (file) -> file.base # the same place
 
 gulp.task 'bundle-after-build', (cb) ->
   sequence = []


# PARAMS:
# --bundle: true/false, default to false
# --online: true/false, default to false
# --lint: true/false, default to false

options =
  bundle: argv.bundle || false
  online: argv.online || false
  lint: argv.lint || false

console.log options

  # TODO currently not that flexible and robust with string replacing
  # TODO currently lib version via CDN is hardcoded

  unless options.cdn?
    return runSequence('noop', cb)

  # 1. index: external libs like lodash, polyfills in index -> jsdelivr
