title: Ionic 2 change name of main.js ( webpack.js output.filename setting)
body: <p>We have an Ionic 2 App that is deployed natively and also to the web.  When building I use <code>npm run build --prod --release</code>.  That just wraps <code>ionic build.</code> </p>
  
  <p>I'm trying to update our build process to be able to swap out the default <code>main.js.</code> that is in the index.html</p>
  
  <p>So I want to be able to change this file from: </p>
  
  <pre><code>&lt;script src="build/main.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>with  (autogenerated hash)</p>
  
  <pre><code>&lt;script src="build/main.7b297e8f7d1c2760a1bc.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Step 1 is to generate the file.  I was able to successfully generate the right file each build by using the webpack output.filename setting.</p>
  
  <pre><code>module.exports = {
     entry: [process.env.IONIC_APP_ENTRY_POINT, './web.config', './src/ai.min.js'],
     output: {
      path: '{{BUILD}}',
      filename: '[name].[chunkhash].js',
  </code></pre>
  
  <p>When I build I can see it's correctly generating the source file but shortly after completing the <code>ionic build</code> fails with a message saying it can't find <code>build/main.js.</code>   That was the original file name so I think I need to somehow let ionic know I'm changing the name of the main.js file.  </p>
  
  <p>Error:</p>
  
  <p><code>
    [11:00:32] build prod failed: ENOENT: no such file or directory, open 
    '/Users/work/client/www/build/main.js'
    [11:00:32] ionic-app-script task: "build"
     [11:00:32] Error: ENOENT: no such file or directory, open '/Users/work/client/www/build/main.js'</code></p>
  
  <p>I'm not sure how to update <code>ionic build</code> so that it knows to look for the dynamically generated main.js filename.</p>