     }).call(this);
     """
 
-MOBWRITE_MINIFIED_JAVASCRIPT = """
+getMobwriteMinifiedJavascript = ->
+  return """
     ;(function(){
       #{fs.readFileSync(path.resolve(MOBWRITE_PATH, "html/compressed_form.js"))};
     }).call(this);

    syncInterval: options?.minSyncInterval or DEFAULT_MIN_SYNC_INTERVAL
    minSyncInterval: options?.minSyncInterval or DEFAULT_MIN_SYNC_INTERVAL
    maxSyncInterval: options?.maxSyncInterval or DEFAULT_MAX_SYNC_INTERVAL
  clientJavascript = """
    ;(function(){
      #{if debug then MOBWRITE_DEBUG_JAVASCRIPT else MOBWRITE_MINIFIED_JAVASCRIPT}
      var options = JSON.parse(#{JSON.stringify(JSON.stringify(clientOptions))})
      for (var key in options) {
        if (options.hasOwnProperty(key)) {
          mobwrite[key] = options[key]
        }
      }
    }).call(this);
    """

  # Create a connect middleware (e.g. for use in ExpressJS).
  # TODO: verify that this works with plain http.createServer()

DEFAULT_MIN_SYNC_INTERVAL = 250
DEFAULT_MAX_SYNC_INTERVAL = 1250

getMobwriteDebugJavascript = ->
  return """
    ;(function(){
      #{fs.readFileSync(path.resolve(MOBWRITE_PATH, "html/diff_match_patch_uncompressed.js"))};
      #{fs.readFileSync(path.resolve(MOBWRITE_PATH, "html/mobwrite_core.js"))};
