admin管理员组

文章数量:1402596

Configure Electron Vite with a Custom Folder Structure

I am working on an Electron Vite project and want to use a custom folder structure instead of the default one. However, I am having trouble configuring Vite and Electron to recognize the files in my desired paths. I am using the Electron Fe documentation to set up my project.

Project Structure

This is the folder structure I want to use:

src
├── main
│   ├── main.js
│   ├── paths.js
│   └── Settings.js
├── preload
│   └── preload.js
├── renderer
│   ├── index.html
│   ├── assets
│   │   ├── icons
│   │   ├── images
│   ├── pages
│   │   ├── createNewFolder
│   │   │   ├── index.html
│   │   │   ├── script.js
│   │   │   ├── style.css
│   │   ├── editor
│   │   │   ├── editor.css
│   │   │   ├── editor.js
│   │   │   ├── explorer.css
│   │   │   ├── explorer.js
│   │   │   ├── index.html
│   │   │   ├── style.css
│   │   │   ├── toolbar.css

Problem

By default, Electron Vite expects a different structure, and I cannot get it to work with this anization.

What I have tried

I tried to modify the main entry of the project and the out dir but nothing seems to work.

My goals are:

  • Configure Vite to use src/main, src/main/preload, and src/renderer.
  • Make Electron work without having to move files to the standard structure.

Question

How can I configure Electron Vite to work with this custom folder structure?

Thanks!

本文标签: Configure Electron Vite with a Custom Folder StructureStack Overflow