Closed JarrodLodge closed 1 year ago
Can you provide a minimal reproduction REPO?
@caoxiemeihao Any ideas? I think i'm just adding the node adodb library wrong in Prod.
electron-builder.json5
{
"extraResources": [
- "electron-store/**/*",
- "node_modules/.electron-store/**/*",
- "node-adodb/**/*",
- "node_modules/.node-adodb/**/*"
+ {
+ "from": "./node_modules/node-adodb/lib/adodb.js",
+ "to": "app/dist/adodb.js"
+ }
]
}
The usage has been written here 👉 https://www.npmjs.com/package/node-adodb#electron
Sorry i still don't know how you got adodb.js to be in the dist folder. Mine goes to the resources/app/dist.
And then secondly the documentation you linked to only shows how to use this library in the electron/main.ts not in the renderer. How do you import this extraResource in the renderer?
Just following up on this, if I unpack the app.asar file. adodb is still in node modules. Not where you show it to be.
The case changes based your repo. But I set asar
value to false
in my local for test it.
"asar": false,
I had to set asar to false to get the same results as you.
I fact, the lib node-adodb
is non-standard. Maybe you can copy node_modules/node-adodb/lib/adodb.js
into public
dir by yourself and Vite will move it to dist automatically after build.
Everything works in dev, only issue I have is that I get a blank screen and missing modules when installing and launching the built app.
I suspect i'm not understanding how to bundle an external node module correctly.
Package.json
vite.config.js