node-api-dotnet
Advanced tools
Comparing version 0.7.14 to 0.7.16
30
init.js
@@ -44,8 +44,32 @@ // Copyright (c) Microsoft Corporation. | ||
/** | ||
* Build tools like webpack are not able to package up dynamic includes like the default case. | ||
* The switch supports the currently packaged DLLs to work with build tools while maintaining | ||
* potential backwards and future compatibility utilizing the default case. | ||
*/ | ||
const assemblyName = 'Microsoft.JavaScript.NodeApi'; | ||
const nativeHostPath = __dirname + `/${rid}/${assemblyName}.node`; | ||
let nativeHost; | ||
switch(rid) { | ||
case 'win-x64': | ||
nativeHost = require(`./win-x64/${assemblyName}.node`); | ||
break; | ||
case 'win-arm64': | ||
nativeHost = require(`./win-arm64/${assemblyName}.node`); | ||
break; | ||
case 'osx-x64': | ||
nativeHost = require(`./osx-x64/${assemblyName}.node`); | ||
break; | ||
case 'osx-arm64': | ||
nativeHost = require(`./osx-arm64/${assemblyName}.node`); | ||
break; | ||
case 'linux-x64': | ||
nativeHost = require(`./linux-x64/${assemblyName}.node`); | ||
break; | ||
default: | ||
// Handle unknown platform (Likely will not work with build tools e.g. webpack) | ||
nativeHost = require(__dirname + `/${rid}/${assemblyName}.node`); | ||
} | ||
const managedHostPath = __dirname + `/${targetFramework}/${assemblyName}.DotNetHost.dll` | ||
const nativeHost = require(nativeHostPath); | ||
// Pass require() and import() functions to the host initialize() method. | ||
@@ -52,0 +76,0 @@ // Since `import` is a keyword and not a function it has to be wrapped in a function value. |
{ | ||
"name": "node-api-dotnet", | ||
"version": "0.7.14", | ||
"version": "0.7.16", | ||
"description": "Node-API bindings for .Net", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
171
12525767
7