title: import.meta.url gets path of source file instead of compiled file
body: <p>Since <code>__dirname</code> is undefined in a typescript electron project, I have resorted to</p>
  <pre><code>import * as path from 'path';
  import { fileURLToPath } from 'url';
  const __filename = fileURLToPath(import.meta.url);
  const __dirname = path.dirname(__filename);
  </code></pre>
  <p>However, this new <code>__dirname</code> gets the directory of the original source file instead of the compiled file. (Paths ends up being <code>/src/something.ts</code> instead of <code>/dist/something.js</code>)</p>
  <p>Is there a way to get the path of the compiled file being run? Am I missing some webpack, tsconfig settings?</p>
  <p>(Unfortunately, <code>app.getAppPath()</code> also seems to rely on <code>__dirname</code>)</p>
  <p><strong>EDIT:</strong> I am trying to load an angular app inside electron through the <code>protocol.registerFileProtocol</code> since plain relative or <code>file://</code> links to not seem to be loaded:</p>
  <pre><code>protocol.registerFileProtocol('resource', (request, callback) =&gt; {
      let url = request.url.substr(11); // Remove the resource://
      callback(path.join(app.getAppPath(), '/', url));
      // or
      callback(path.join(__dirname, '/', url));
  });
  </code></pre>