         bundle.setProductionEnvironment
         bundle.findLinks
         bundle.aggregateLinks
+        bundle.loadLinks
         bundle.optimize
         bundle.rewriteHtml
         ]

        
        callback null, this

    # (6) concatenate and optimize scripts and stylesheets
    optimize: (self..., callback) ->
        scripts = @links.scripts
            .map (ref) =>
                # TODO: everything should exist and have content, so 
                # the existential operator needs to go
                (@find '/' + ref)?.content
            .join ';\n'
        
        @push @root + '/application.min.js', 

                el = $ @
                # we can't remove all scripts -- absolute references to
                # external scripts and styles should be kept intact
                relative = el.attr('src').indexOf('/') isnt 0
                internal = el.attr('src').indexOf('http') isnt 0
                util = el.hasClass('jsdom')
                
                if util or relative or internal
                    el.remove()
                
            script = window.document.createElement('script')
