How to Add Folders to Final Build #435
Unanswered
VitorAndrey
asked this question in
Q&A
Replies: 2 comments 4 replies
-
check out https://electron-vite.org/guide/assets |
Beta Was this translation helpful? Give feedback.
0 replies
-
import jsonFile from '../../resources/xx.json?commonjs-external&asset'
// get the public dir path
const dir = path.dirname(jsonFile) |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Electron + Vite community!👋,
I'm encountering an issue when adding folders to the final build of my project using Electron + Vite. During development, everything works perfectly; however, after building the application, an error is thrown, indicating that the migrations folder cannot be found, as if the path used in development is not valid after the build.
Here is where I use the migrations folder path, which works in development, but after the build, it seems that
src/database/migrations
does not resolve to the right path.The problem was previously discussed in the context of Electron + Webpack on Discord, where a user resolved the problem by manually copying the necessary folder to the output package. The solution using Webpack involved adding configurations to manually copy the migrations folder during the build.
Now, I am seeking guidance on how to achieve the same result in the context of Electron + Vite. If anyone can provide insights or specific suggestions on configuring Electron + Vite to include necessary folders in the final build, I would greatly appreciate it.
The error that occurs after the build suggests that the /database folder may not be included in the built version.
Thank you for your attention and support!
Beta Was this translation helpful? Give feedback.
All reactions