node-api-dotnet 0.7.13 → 0.7.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/init.js +27 -3
- package/linux-x64/Microsoft.JavaScript.NodeApi.node +0 -0
- package/net472/Microsoft.JavaScript.NodeApi.DotNetHost.dll +0 -0
- package/net472/Microsoft.JavaScript.NodeApi.dll +0 -0
- package/net6.0/Microsoft.JavaScript.NodeApi.DotNetHost.dll +0 -0
- package/net6.0/Microsoft.JavaScript.NodeApi.dll +0 -0
- package/net8.0/Microsoft.JavaScript.NodeApi.DotNetHost.dll +0 -0
- package/net8.0/Microsoft.JavaScript.NodeApi.dll +0 -0
- package/osx-arm64/Microsoft.JavaScript.NodeApi.node +0 -0
- package/osx-x64/Microsoft.JavaScript.NodeApi.node +0 -0
- package/package.json +1 -1
- package/win-arm64/Microsoft.JavaScript.NodeApi.node +0 -0
- package/win-x64/Microsoft.JavaScript.NodeApi.node +0 -0
package/init.js
CHANGED
|
@@ -41,11 +41,35 @@ function initialize(targetFramework) {
|
|
|
41
41
|
targetFramework = defaultTargetFramework;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Build tools like webpack are not able to package up dynamic includes like the default case.
|
|
46
|
+
* The switch supports the currently packaged DLLs to work with build tools while maintaining
|
|
47
|
+
* potential backwards and future compatibility utilizing the default case.
|
|
48
|
+
*/
|
|
44
49
|
const assemblyName = 'Microsoft.JavaScript.NodeApi';
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
let nativeHost;
|
|
51
|
+
switch(rid) {
|
|
52
|
+
case 'win-x64':
|
|
53
|
+
nativeHost = require(`./win-x64/${assemblyName}.node`);
|
|
54
|
+
break;
|
|
55
|
+
case 'win-arm64':
|
|
56
|
+
nativeHost = require(`./win-arm64/${assemblyName}.node`);
|
|
57
|
+
break;
|
|
58
|
+
case 'osx-x64':
|
|
59
|
+
nativeHost = require(`./osx-x64/${assemblyName}.node`);
|
|
60
|
+
break;
|
|
61
|
+
case 'osx-arm64':
|
|
62
|
+
nativeHost = require(`./osx-arm64/${assemblyName}.node`);
|
|
63
|
+
break;
|
|
64
|
+
case 'linux-x64':
|
|
65
|
+
nativeHost = require(`./linux-x64/${assemblyName}.node`);
|
|
66
|
+
break;
|
|
67
|
+
default:
|
|
68
|
+
// Handle unknown platform (Likely will not work with build tools e.g. webpack)
|
|
69
|
+
nativeHost = require(__dirname + `/${rid}/${assemblyName}.node`);
|
|
70
|
+
}
|
|
47
71
|
|
|
48
|
-
const
|
|
72
|
+
const managedHostPath = __dirname + `/${targetFramework}/${assemblyName}.DotNetHost.dll`
|
|
49
73
|
|
|
50
74
|
// Pass require() and import() functions to the host initialize() method.
|
|
51
75
|
// Since `import` is a keyword and not a function it has to be wrapped in a function value.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|