def javascript_tags(volt_app)
      @opal_tag_generator ||= Opal::Server::Index.new(nil, volt_app.opal_files.server)

      javascript_files = []
      @assets.each do |type, path|
        case type
          when :folder
            # for a folder, we search for all .js files and return a tag for them
            base_path = base(path)
            javascript_files += Dir["#{path}/**/*.js"].sort.map do |folder|
              # Grab the component folder/assets/js/file.js
              local_path = folder[path.size..-1]
              @app_url + '/' + base_path + local_path
            end
          when :javascript_file
            # javascript_file is a cdn path to a JS file
            javascript_files << path
        end
      end

      javascript_files = javascript_files.uniq

      scripts = javascript_files.map {|url| "<script src=\"#{url}\"></script>" }

      # Include volt itself.  Unless we are running with MAPS=all, just include
      # the main file without sourcemaps.
      volt_path = 'volt/volt/app'
      if ENV['MAPS'] == 'all'
        scripts << @opal_tag_generator.javascript_include_tag(volt_path)
      else
        scripts << "<script src=\"#{volt_app.app_url}/#{volt_path}.js\"></script>"
        scripts << "<script>#{Opal::Processor.load_asset_code(volt_app.sprockets, volt_path)}</script>"
      end

      scripts << @opal_tag_generator.javascript_include_tag('components/main')

      scripts.join("\n")
    end
def javascript_tags(volt_app)
      @opal_tag_generator ||= Opal::Server::Index.new(nil, volt_app.opal_files.server)

      javascript_files = []
      @assets.each do |type, path|
        case type
          when :folder
            # for a folder, we search for all .js files and return a tag for them
            base_path = base(path)
            javascript_files += Dir["#{path}/**/*.js"].sort.map do |folder|
              # Grab the component folder/assets/js/file.js
              local_path = folder[path.size..-1]
              @app_url + '/' + base_path + local_path
            end
          when :javascript_file
            # javascript_file is a cdn path to a JS file
            javascript_files << path
        end
      end

      javascript_files = javascript_files.uniq

      scripts = javascript_files.map {|url| "<script src=\"#{url}\"></script>" }

      # Include volt itself.  Unless we are running with MAPS=all, just include
      # the main file without sourcemaps.
      volt_path = 'volt/volt/app'
      if ENV['MAPS'] == 'all'
        scripts << @opal_tag_generator.javascript_include_tag(volt_path)
      else
        scripts << "<script src=\"#{volt_app.app_url}/#{volt_path}.js\"></script>"
        scripts << "<script>#{Opal::Processor.load_asset_code(volt_app.sprockets, volt_path)}</script>"
      end

      scripts << @opal_tag_generator.javascript_include_tag('components/main')

      scripts.join("\n")
    end
Returns script tags that should be included