Compare commits
2 Commits
1943684006
...
883f811f91
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | 883f811f91 | |
Derrick Hammer | e3199939b0 |
|
@ -13,13 +13,18 @@ const loaderFunction = `function loadNativeModuleTemp(module, data) {
|
||||||
const tempDir = require("os").tmpdir();
|
const tempDir = require("os").tmpdir();
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const outputPath = path.join(tempDir, module, "build", "Release");
|
const loadPath = path.join(tempDir, module);
|
||||||
|
const outputPath = path.join(loadPath, "build", "Release");
|
||||||
const modulePath = path.join(outputPath, module + ".node");
|
const modulePath = path.join(outputPath, module + ".node");
|
||||||
|
|
||||||
fs.mkdirSync(outputPath, { recursive: true });
|
fs.mkdirSync(outputPath, { recursive: true });
|
||||||
fs.writeFileSync(modulePath, Buffer.from(data, "base64"));
|
fs.writeFileSync(modulePath, Buffer.from(data, "base64"));
|
||||||
|
|
||||||
return modulePath;
|
if (process.pkg) {
|
||||||
|
process.pkg = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
return loadPath;
|
||||||
}`;
|
}`;
|
||||||
function bundleNativeModulesPlugin() {
|
function bundleNativeModulesPlugin() {
|
||||||
const edits = [];
|
const edits = [];
|
||||||
|
|
|
@ -10,13 +10,18 @@ const loaderFunction = `function loadNativeModuleTemp(module, data) {
|
||||||
const tempDir = require("os").tmpdir();
|
const tempDir = require("os").tmpdir();
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const outputPath = path.join(tempDir, module, "build", "Release");
|
const loadPath = path.join(tempDir, module);
|
||||||
|
const outputPath = path.join(loadPath, "build", "Release");
|
||||||
const modulePath = path.join(outputPath, module + ".node");
|
const modulePath = path.join(outputPath, module + ".node");
|
||||||
|
|
||||||
fs.mkdirSync(outputPath, { recursive: true });
|
fs.mkdirSync(outputPath, { recursive: true });
|
||||||
fs.writeFileSync(modulePath, Buffer.from(data, "base64"));
|
fs.writeFileSync(modulePath, Buffer.from(data, "base64"));
|
||||||
|
|
||||||
return modulePath;
|
if (process.pkg) {
|
||||||
|
process.pkg = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
return loadPath;
|
||||||
}`;
|
}`;
|
||||||
|
|
||||||
type Edit = [number, number];
|
type Edit = [number, number];
|
||||||
|
|
Loading…
Reference in New Issue