title: RequireJS + Algolia Docsearch throws mismatched anonymous define()..error
body: <p>I am trying to implement Algolia Docsearch with MadCap Flare. Flare is a technical documentation tool that generates HTML output. </p>
  
  <p>Docsearch's underlying crawler is configured and works properly in codepen. However, I am having an issue integrating it with Flare. Flare has a number of inbuilt scripts, which I cannot access or change, including <strong>require.js</strong>. I get a bunch of errors, <strong>Uncaught Error: Mismatched anonymous define() module..</strong>, when I run the build. </p>
  
  <p>So to fix this, I gave a stab at loading the Docsearch js using <code>require.js</code>, which I am doing completely wrong. My JS knowledge is limited!</p>
  
  <p>Html search input:</p>
  
  <pre><code>&lt;div class="input-group"&gt;
      &lt;input id="&lt;YOUR_CSS_SELECTOR&gt;"  type="text" class="form-control" placeholder="Search" aria-label="Search Field" aria-describedby="infoSearch" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Original Algolia Docsearch CDN js and snippet is something like this:</p>
  
  <pre><code>&lt;!-- Before the closing &lt;/body&gt; --&gt;
      &lt;script src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"&gt;
      &lt;/script&gt;
      &lt;script&gt;
      docsearch({
          apiKey: '&lt;API_KEY&gt;',
          indexName: '&lt;INDEX_NAME&gt;',
          inputSelector: '&lt;YOUR_CSS_SELECTOR&gt;',
          debug: false
      });
      &lt;/script&gt;
  </code></pre>
  
  <p>So to load these scripts using <code>require.js</code> I have done the following:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  require.config({
      enforceDefine: true,
      paths: {
          "docSearch": "https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"
      },
      waitSeconds: 40
  });
  require(['docSearch']);//This is probably not doing anything.
  &lt;/script&gt;
  &lt;script&gt;
  docsearch({
      apiKey: '&lt;API_KEY&gt;',
      indexName: '&lt;INDEX_NAME&gt;',
      inputSelector: '&lt;YOUR_CSS_SELECTOR&gt;',
      debug: false
  }); //This throws "Uncaught Reference Error docsearch is not defined" error
  &lt;/script&gt;
  </code></pre>
  
  <p>I looked at other threads/questions and require.js docs as well, but couldn't find something that could figure out. Any help/guidance would be great!</p>