electron / electron/forge

Document how to use file-loader correctly for renderer webpack configs

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

Description

Assets are not getting loaded after making the binary using "yarn make" on all platform (windows/Mac/Linux). We are getting error "net::ERR_FILE_NOT_FOUND". Looks like Js files are pointing to the proper location as per the package.json configuration. but assets and source files are located in different location.

And we are seeing the same issue for component source which uses Lazy import statements
```
const Login = React.lazy(() => import('./screens/login'));
```

E.g on Mac

```
Trying to load the png file from
/Contents/Resources/app/.webpack/renderer/main_window/33dbdd0177549353eeeb785d02c294af.png

But files are available in.
/Contents/Resources/app/.webpack/renderer/33dbdd0177549353eeeb785d02c294af.png

```

package.json
```
"plugins": [
[
"@electron-forge/plugin-webpack",
{
"mainConfig": "./webpack.main.config.js",
"renderer": {
"config": "./webpack.renderer.config.js",
"entryPoints": [
{
"html": "./src/index.html",
"js": "./src/app.tsx",
"name": "main_window"
}
]
}
}
]
]
```

[Sample Project https://github.com/jega-ms/electron-forge-react-typescript-webpack ](https://github.com/jega-ms/electron-forge-react-typescript-webpack
)

Screen Shot 2020-01-23 at 5 23 08 PM

File Listing

Screen Shot 2020-01-23 at 5 30 23 PM

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.