title: How to reduce Electron package size that exceeds more than 600 mb
body: <p>I see this is because of node-modules and application is packaged with some unwanted stuffs for running. Current file size is 600 mb but I want it to be less than 200 mb.</p>
  
  <p>I suspect --no-prune populates all the node-modules in package that is built, but I need only specifies node-modules in the package that is built</p>
  
  <p>I tried removing unwanted packages in package.json, it doesn't help me either</p>
  
  <p><strong>after refactoring</strong></p>
  
  <pre><code> "bundledDependencies": [
  
      "fs",
  
      "os",
      "path",
  
      "regedit",
      "request",
      "start",
      "xml2js",
      "util",
      "replace",
      "process",
      "fs",
      "console"
  
    ],
  **before refactoring**
   "bundledDependencies": [
      "archiver",
      "child_process",
      "fs",
      "node-wget",
      "os",
      "path",
      "ping",
      "regedit",
      "request",
      "start",
      "xml2js",
      "util",
      "replace",
      "process",
      "fs",
      "console",
      "electron",
      "electron-builder",
      "electron-packager"
    ],
  </code></pre>
  
  <p>this didn't help me either</p>
  
  <p><strong>package.json</strong></p>
  
  <pre><code>{
    "productName": "xyz",
    "description": "something",
    "version": "1.0.1",
    "main": "main.js",
    "scripts": {
      "start": "electron .",
  
      "builderForWindows": "electron-packager --out winx64 --overwrite --platform win32 --appname clientsettings . --executable-name abc --no-prune",
      "builderForLinux": "electron-packager --out Linx64 --overwrite --platform linux --appname clientsettings .  --executable-name abc --no-prune"
    },
    "author": "xyz",
    "devDependencies": {
      "archiver": "^2.1.1",
      "asar": "^2.0.1",
      "child_process": "^1.0.2",
      "console": "^0.7.2",
      "electron": "^4.0.4",
      "electron-builder": "^20.41.0",
      "electron-packager": "^13.1.1",
      "fs": "0.0.1-security",
      "node-wget": "^0.4.2",
      "os": "^0.1.1",
      "path": "^0.12.7",
      "ping": "^0.2.2",
      "regedit": "^3.0.2",
      "replace": "^1.1.0",
      "replace-in-file": "^4.1.0",
      "request": "^2.85.0",
      "start": "^5.1.0",
      "xml2js": "^0.4.19"
    },
    "bundledDependencies": [
      "archiver",
      "child_process",
      "fs",
      "node-wget",
      "os",
      "path",
      "ping",
      "regedit",
      "request",
      "start",
      "xml2js",
      "util",
      "replace",
      "process",
      "fs",
      "console",
      "electron",
      "electron-builder",
      "electron-packager"
    ],
    "dependencies": {
      "appdata-path": "^1.0.0",
      "targets": "^1.11.0"
    }
  }
  
  </code></pre>