Skip to content

Commit 7ad3d4b

Browse files
committed
Fixed Webpack bundled package.json
- Removed `postinstall` section. It wasn't in script section of `package.json` anyway. - Put `electron` back in `devDependencies` so anyone having the compiled package can run the app with Electron.
1 parent f899656 commit 7ad3d4b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

webpack.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,17 @@ mainConfig.plugins = [
5757
{
5858
from: 'package.json',
5959
to: 'package.json',
60-
transform: (content, _path) => { // eslint-disable-line no-unused-vars
60+
transform: (content, _path) => {
6161
const jsonContent = JSON.parse(content);
62+
const electronVersion = jsonContent.devDependencies.electron;
6263

6364
delete jsonContent.devDependencies;
6465
delete jsonContent.scripts;
6566
delete jsonContent.build;
6667

6768
jsonContent.main = './main.bundle.js';
6869
jsonContent.scripts = { start: 'electron ./main.bundle.js' };
69-
jsonContent.postinstall = 'electron-builder install-app-deps';
70+
jsonContent.devDependencies = { electron: electronVersion }
7071

7172
return JSON.stringify(jsonContent, undefined, 2);
7273
},

0 commit comments

Comments
 (0)