Unable to import local modules into main.js in app built with vite template
- 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
v24.1.2
### Operating system
Ubuntu 20.4.6
### Last known working Electron Forge version
_No response_
### Expected behavior
App allows importing/requiring local files into main.js
### Actual behavior
App throws an error when started
```
Uncaught Exception:
Error: Cannot find module './mod'
Require stack:
- /PROJECT_PATH/.vite/build/main.js
- /PROJECT_PATH/node_modules/electron/dist/resources/default_app.asar/main.js
```
### Steps to reproduce
1. Scaffold a new application with command: `yarn create electron-app my-app --template=vite`
2. Create any JS file, e.g. mod.js
3. Require mod.js in the main.js file.
4. Run `yarn start`
### Additional information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.