title: How to reduce the size of electron angular app
body: <p>I am trying to design an angular app for windows and Linux platforms. I am using the electron framework. I just built a simple app that displays the angular home page. The size of this app is around 250MB. This is too large. If anyone has developed an electron-angular app. Can you mention the size of your app. And any tips on how to reduce the size of the application.
  Note: Angular app is compiled to /dist, its size is just 250KB but when the whole app is built is 250MB!</p>
  <p>** main.js**</p>
  <pre><code>const { app, BrowserWindow } = require('electron')
  
  let win;
  
  console.log(__dirname);
  function createWindow () {
    // Create the browser window.
    win = new BrowserWindow({
      width: 600, 
      height: 600,
      backgroundColor: '#ffffff',
      icon: `file://${__dirname}/dist/Angular-electron/favicon.ico`
    })
  
  
    win.loadURL(`file://${__dirname}/dist//Angular-electron/index.html`)
  
    //// uncomment below to open the DevTools.
    // win.webContents.openDevTools()
  
    // Event when the window is closed.
    win.on('closed', function () {
      win = null
    })
  }
  
  // Create window on electron intialization
  app.on('ready', createWindow)
  
  // Quit when all windows are closed.
  app.on('window-all-closed', function () {
  
    // On macOS specific close process
    if (process.platform !== 'darwin') {
      app.quit()
    }
  })
  
  app.on('activate', function () {
    // macOS specific close process
    if (win === null) {
      createWindow()
    }
  })
  </code></pre>
  <p>Below is the root component.</p>
  <p><strong>app.component.html</strong></p>
  <pre><code>&lt;div style=&quot;text-align:center&quot;&gt;
    &lt;h1&gt;
      Welcome to {{ title }}!
    &lt;/h1&gt;
  &lt;/div&gt;
  </code></pre>
  <p><strong>app.component.ts</strong></p>
  <pre><code>import { Component } from '@angular/core';
  
  @Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
  })
  export class AppComponent {
    title = 'Angular-electron';
   
  }
  
  </code></pre>
  <p>This is the package.json script, I build the angular and simultaneously build electron as shown below
  Note: I use the electron-packager to build the app for production.</p>
  <pre><code>&quot;builderForWindows&quot;: &quot;ng build --prod &amp;&amp; electron-packager ./dist --out winx64 --overwrite --platform win32 &quot;
  </code></pre>
  <p>Below is the screenshot of the application.
  <a href="https://i.stack.imgur.com/w7kvL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w7kvL.png" alt="enter image description here" /></a></p>