Skip to content

Commit

Permalink
Fixed some stuff with the js build system, upgraded watchpack, and am…
Browse files Browse the repository at this point in the history
… syncing libvorejs with libvore updates
  • Loading branch information
jmeaster30 committed Apr 8, 2023
1 parent 0773763 commit 1544371
Show file tree
Hide file tree
Showing 3 changed files with 229 additions and 178 deletions.
7 changes: 5 additions & 2 deletions libvorejs/go-loader.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const {readFileSync, unlinkSync} = require("fs");
const {join} = require("path");
const {execFile} = require("child_process");
const which = require('which');

const proxyBuilder = (wasmFile) => `
require('../lib/wasm_exec.js');
Expand Down Expand Up @@ -71,7 +72,7 @@ function loadwasm(bytes) {
export default loadwasm('${wasmFile}');
`;

module.exports = function loader(contents) {
module.exports = async function loader(contents) {
const cb = this.async();

const opts = {
Expand All @@ -87,7 +88,9 @@ module.exports = function loader(contents) {
const outFile = `${this.resourcePath}.wasm`;
const args = ["build", "-o", outFile, this.resourcePath];

execFile("go", args, opts, (err) => {
execFile(which.sync('go'), args, opts, (err, stdout, stderr) => {
console.log(stdout)
console.log(stderr)
console.log("compiled")
if (err) {
cb(err);
Expand Down
Loading

0 comments on commit 1544371

Please sign in to comment.