     file: (ob, cb) ->
       fs.readFile ob.filePath, (err, data) =>
         return cb? err if err
-        @getCompiler(ob.filePath) data.toString(), (err, code) ->
+        getCompiler(ob.filePath) data.toString(), (err, code) ->
           cb err, code
 
-
+  return ->
+    @getId = getId
+    @getCode = (cb) ->
+      pilers[@type] @, cb
+    return @
+
+
+class BasePile
+
+  production: false
 
   constructor: (@name, @production) ->
     @code = []


  pileUp: (cb) ->

    async.map @code, (ob, cb) =>
      piler = @pilers[ob.type]
      piler.call @, ob, (err, code) =>
        return cb? err if err
        cb null, @commentLine("#{ ob.type }: #{ ob.uid }") + "\n#{ code }"

    , (err, result) =>
      return cb? err if err

      tags += "\n"
    else
      for ob in @code
        tags += @wrapInTag "/pile/#{ @name }.dev-#{ ob.type }-#{ ob.getId() }.#{ @ext }", "id=\"pile-#{ ob.getId() }\""
        tags += "\n"

    tags


  findCodeObById: (id) ->
    (codeOb for codeOb in @code when codeOb.getId() is id)[0]

  findCodeObByFilePath: (path) ->
    (codeOb for codeOb in @code when codeOb.filePath is id)[0]


  getProductionUrl: ->
    "#{ @urlRoot }#{ @name }.min.#{ @ext }"
