electron-userland / electron-userland/electron-webpack
Hot reload question
- Dominant language
- TypeScript
- Stars
- 902
- Forks
- 168
- PR merge metrics
- No merged PRs in 30d
Description
Hi! When I change main file of the electron app it rebuilds successfully but the app continues using the old file.
What I'm missing?
My webpack config
`const path = require('path');
module.exports = {
entry: './electron/main.ts',
devtool: 'inline-source-map',
target: 'electron-main',
node: {
__dirname: false
},
output: {
filename: 'main.js',
publicPath: path.join(__dirname, 'dist', 'main'),
path: path.join(__dirname, 'dist', 'main'),
},
resolve: {
extensions: [ '.tsx', '.ts', '.js' ]
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}
]
},
devServer: {
contentBase: path.join(__dirname, 'dist'),
publicPath: path.join(__dirname, 'dist', 'main'),
compress: true,
port: 9000
}
};
`
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the webpack configuration shown in the issue, especially the electron/main.ts entry and the dist/main output path; trace which file the running Electron app loads after a rebuild. Confirm the behavior with the configured dev server and determine what would make the app use the rebuilt main.js rather than the previous file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- babel, electron, typescript, webpack
- Domain
- build-system, desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100