Skip to content

Commit

Permalink
Reduce Electron app size (microsoft#770)
Browse files Browse the repository at this point in the history
* Don’t include node_modules in Electron build

Signed-off-by: Mick Vleeshouwer <[email protected]>

* Update electron from 8 to 10

Signed-off-by: Mick Vleeshouwer <[email protected]>

Co-authored-by: stew-ro <[email protected]>
  • Loading branch information
iMicknl and stew-ro authored Nov 16, 2020
1 parent e19d372 commit 4fcd7ff
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 124 deletions.
1 change: 1 addition & 0 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ extends: null # need this otherwise it won't use the entry point we set in "main
files:
- filter:
- build/ # copy this directory to the asar directory that electron-builder use to look for the main entry file
- "!node_modules/**/*" # don't include node_modules since Webpack is used to combine all packages
mac:
icon: app-icons/icon.icns
target: dmg
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@
"@types/reactstrap": "^8.2.0",
"@types/redux-logger": "^3.0.7",
"acorn": "^7.1.1",
"electron": "8.3.0",
"electron-builder": "^22.6.1",
"electron": "10.1.5",
"electron-builder": "^22.9.1",
"env-cmd": "^10.1.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.15.1",
Expand Down
1 change: 1 addition & 0 deletions src/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ async function createWindow() {
windowOptions.webPreferences = {
nodeIntegration: true,
webSecurity: false,
enableRemoteModule: true
};

const staticUrl = process.env.ELECTRON_START_URL || `file:///${__dirname}/index.html`;
Expand Down
Loading

0 comments on commit 4fcd7ff

Please sign in to comment.