title: How do I create a standalone mode extension for ACE?
body: <p>I'd like to extend ace with a mode for a custom language.  As far as I can tell, the general process is:</p>
  
  <ol>
  <li>Download the ace source.</li>
  <li>Create a new lib/ace/mode/foo.js for your custom language.</li>
  <li>run "make build" (or similar) to rebuild ACE.</li>
  <li>Use the newly compiled build/src-min-no-conflict (or whatever) ACE distribution in your website.</li>
  </ol>
  
  <p>But I want to just use an existing ACE distribution from their website, combined with my standalone new mode.  I don't want to have to rebuild ACE as part of my build process in order to build my new mode.  I got close by doing:</p>
  
  <pre><code>ace.config.setModuleUrl("foo-mode", "./foo.js");
  session.setMode("foo-mode");
  </code></pre>
  
  <p>But I quickly ran into requirejs / dependency problems.  For instance I couldn't do <code>require("ace/mode/matching_brace_outdent")</code> inside my mode.  I temporarily hacked around that by first calling <code>setMode('ace/mode/c_cpp')</code> (which as a byproduct defines the matching_brace_outdent module).  But I ran into even worse problems trying to get a custom WorkerClient to work.</p>
  
  <p>Is my only option to build my mode as part of ACE?  Or am I missing something?</p>