Open reitowo opened 3 days ago
The changes mainly are, replacing relative path to absolute paths.
I think we can also first require.resolve
the 'node-api-dotnet', and resolve the absolute path, for better compatibility.
Also, replace require with createRequire is also necessary.
After days of research I wrote a plugin to make this cool
node-api-dotnet
works with electron. Hope it can help people later....
vite: { plugins: [ resolve(), commonjs({ exclude: [ "node_modules/node-api-dotnet/**" ] }), electronNodeDotNetApi({ nodeModulePath: path.join(projectRootDir, 'node_modules/node-api-dotnet'), csprojOutputPath: csharpOutputDir }), ] }