electron / electron/forge

Can't set webpack config of preload file

Open
#3,226 2 comments 1 reaction 0 assignees View on GitHub
plugin/webpack
Dominant language
TypeScript
Stars
7.1k
Forks
641
Avg merge
3d 1h
Merged PRs (30d)
30

Description

### Pre-flight checklist

- [X] I have read the [contribution documentation](https://github.com/electron/forge/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [code of conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project uses.
- [X] I have searched the issue tracker for a bug that matches the one I want to file, without success.

### Electron Forge version

6.1.1

### Electron version

17.4.11

### Operating system

Window 10 (19045)

### Last known working Electron Forge version

unkonw

### Expected behavior

Preload js should wrap by webpack.

### Actual behavior

Not do the expected behavior.

### Steps to reproduce

```
renderer: {
config: rendererConfig,
entryPoints: [
{
js: './src/main.ts',
name: 'main',
preload: {
js: './electron/preload.js',
config: {
entry: "./electron/preload.js",
output: {
path: path.resolve(__dirname, ".webpack/main"),
filename: '[name].js',
},
resolve: {
extensions: [".js"],
}
},
},
},
],
},
```
I'm sure that main and renderer webpack output not clean up work directory.

### Additional information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.