title: Webpack/Angular CLI - how to embed scripts in HTML instead of referencing them?
body: <p>I'm building a lean Angular app that should be ran locally through <code>file://</code> URL.
  The <code>index.html</code> file will be attached and deployed through a headless browser and I cannot use a HTTP server as a solution. Running the file locally would bring up Cross Origin errors as described <a href="https://stackoverflow.com/questions/10752055/cross-origin-requests-are-only-supported-for-http-error-when-loading-a-local">here</a>.</p>
  
  <p>The solution I came up with, which works (!) is to replace all <code>&lt;script src="..."/&gt;</code> resources (which are bundled with <code>ng build --prod</code>) with <code>&lt;script&gt;...&lt;/script&gt;</code>. At the moment, I'm doing it <strong>manually</strong>.</p>
  
  <p>With the output <code>index.html</code> from my <code>ng build</code> being:</p>
  
  <pre><code>&lt;script src="runtime-es2015.1eba213af0b233498d9d.js" type="module"&gt;&lt;/script&gt;&lt;script src="runtime-es5.1eba213af0b233498d9d.js" nomodule defer&gt;&lt;/script&gt;&lt;script src="polyfills-es5.9e286f6d9247438cbb02.js" nomodule defer&gt;&lt;/script&gt;&lt;script src="polyfills-es2015.690002c25ea8557bb4b0.js" type="module"&gt;&lt;/script&gt;&lt;script src="main-es2015.3bdd714db04c3d863447.js" type="module"&gt;&lt;/script&gt;&lt;script src="main-es5.3bdd714db04c3d863447.js" nomodule defer&gt;&lt;/script&gt;
  </code></pre>
  
  <p>I'm changing it to:</p>
  
  <pre><code>&lt;script type="module"&gt;//content of runtime-es2015.1eba213af0b233498d9d.js//&lt;/script&gt;&lt;script nomodule defer&gt;//content of runtime-es5.1eba213af0b233498d9d.js//&lt;/script&gt;&lt;script nomodule defer&gt;//content of polyfills-es5.9e286f6d9247438cbb02.js//&lt;/script&gt;&lt;script type="module"&gt;//content of polyfills-es2015.690002c25ea8557bb4b0.js//&lt;/script&gt;&lt;script type="module"&gt;//content of main-es2015.3bdd714db04c3d863447.js//&lt;/script&gt;&lt;script nomodule defer&gt;//content of main-es5.3bdd714db04c3d863447.js//&lt;/script&gt;
  </code></pre>
  
  <p>I'm looking for a way to automate it through the build script.</p>
  
  <p>Thanks.</p>