Pack resolc.wasm and resolc.js to resolc_packed.js

This commit is contained in:
Sebastian Miasojed
2025-01-23 11:59:50 +01:00
parent 888723eb0d
commit 8a18f08aff
16 changed files with 420 additions and 377 deletions
+9 -11
View File
@@ -1,18 +1,16 @@
importScripts('./soljson.js');
importScripts('./resolc.js');
importScripts("./soljson.js");
importScripts("./resolc.js");
// Handle messages from the main thread
onmessage = async function (e) {
const m = createRevive();
const m = createRevive();
m.soljson = Module;
m.soljson = Module;
// Set input data for stdin
m.writeToStdin(e.data);
// Set input data for stdin
m.writeToStdin(e.data);
// Compile the Solidity source code
m.callMain(["--standard-json"]);
// Compile the Solidity source code
m.callMain(['--standard-json']);
postMessage({output: m.readFromStdout() || m.readFromStderr()});
postMessage({ output: m.readFromStdout() || m.readFromStderr() });
};