main.worker.js? What's that?
<p>I am building a PDF viewer in Ionic 2 using the <a href="https://github.com/mozilla/pdf.js" rel="nofollow noreferrer">Mozilla PDF Viewer</a> but have run into a problem. I have built <code>pdf.js</code> in accordance with <a href="https://github.com/mozilla/pdf.js/#building-pdfjs" rel="nofollow noreferrer">these instructions</a>. The code generated includes this line:</p>

<pre><code>var worker = new Worker(workerSrc);
</code></pre>

<p>Chrome is complaining on this line that it cannot find the file <code>GET http://localhost:8100/build/main.worker.js</code>.</p>

<p>Now then, I have not come across web workers before, so I'm not sure what this error means or where to find, or build, this file. I notice that the build process also yields a file called <code>pdf.worker.js</code>, and I have strong suspicions that this might be the file it's after, although renaming it to <code>main.worker.js</code> had no effect.</p>

<p>I'm sure this is a very simple problem if you are in the know. What am I missing?</p>

<p><hr></p>

<p>Ok, after a little more digging, I found <a href="https://github.com/mozilla/pdf.js/wiki/Setup-pdf.js-in-a-website" rel="nofollow noreferrer">this</a> which pertains more to my situation. I am using Ionic 2 and I don't know how to generate the file referenced in this line:</p>

<pre><code>pdfjsLib.PDFJS.workerSrc = '../../build/webpack/pdf.worker.bundle.js';
</code></pre>

<p>Can anyone illuminate my dark mind?</p>