Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build-renderer": "cross-env NODE_ENV=production webpack --config webpack.renderer.prod.config.js",
"build": "npm run build-main && npm run build-renderer",
"start-renderer-dev": "webpack-dev-server --config webpack.renderer.dev.config.js",
"start-main-dev": "webpack --config webpack.main.config.js && electron ./dist/main.js",
"start-main-dev": "webpack --config webpack.main.config.js",
"start-dev": "cross-env START_HOT=1 npm run start-renderer-dev",
"prestart": "npm run build",
"start": "electron .",
Expand Down Expand Up @@ -125,6 +125,7 @@
"jest": "^24.8.0",
"lint-staged": "^10.0.7",
"node-sass": "^4.12.0",
"nodemon-webpack-plugin": "^4.3.1",
"prettier": "^1.18.2",
"react-hot-loader": "^4.8.8",
"react-test-renderer": "^16.8.6",
Expand Down
6 changes: 6 additions & 0 deletions webpack.main.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ const path = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const NodemonPlugin = require('nodemon-webpack-plugin');

const baseConfig = require('./webpack.base.config');

module.exports = merge.smart(baseConfig, {
target: 'electron-main',
watch: true,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you add this, I believe you need the inverse on webpack.main.prod.config.js since it inherits the config from this.

entry: {
main: './src/main/main.ts'
},
Expand Down Expand Up @@ -39,6 +41,10 @@ module.exports = merge.smart(baseConfig, {
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development')
}),
new NodemonPlugin({
watch: path.resolve('./dist'),
exec: "electron ./dist/main.js"
})
]
});