Use componentize-qjs instead.
This commit is contained in:
parent
1a9c0d3b8b
commit
dcd04be1bf
2822
package-lock.json
generated
2822
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -20,10 +20,10 @@
|
|||||||
"prepare": "jco guest-types wit/v0.1 -n plugin -o dist/bindings --name index"
|
"prepare": "jco guest-types wit/v0.1 -n plugin -o dist/bindings --name index"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@bytecodealliance/componentize-js": "^0.21.0",
|
"componentize-qjs": "^0.4.5",
|
||||||
"esbuild": "^0.28.0"
|
"esbuild": "^0.28.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@bytecodealliance/jco": "^1.19.0"
|
"@bytecodealliance/jco": "^1.34.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
17
src/build.js
17
src/build.js
@ -1,10 +1,7 @@
|
|||||||
#! /usr/bin/env node
|
#! /usr/bin/env node
|
||||||
|
|
||||||
import * as esbuild from "esbuild";
|
import * as esbuild from "esbuild";
|
||||||
import {
|
import { componentize } from "componentize-qjs";
|
||||||
componentize,
|
|
||||||
version as componentize_version,
|
|
||||||
} from "@bytecodealliance/componentize-js";
|
|
||||||
import * as path from "node:path";
|
import * as path from "node:path";
|
||||||
import * as fs from "node:fs";
|
import * as fs from "node:fs";
|
||||||
|
|
||||||
@ -22,14 +19,14 @@ async function buildPlugin(entryPath, outputPath, witDir) {
|
|||||||
external: ["pumpkin:plugin/*"],
|
external: ["pumpkin:plugin/*"],
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(
|
console.log(`2. Running through \`componentize-qjs\`...`);
|
||||||
`2. Running through \`componentize-js\` ` + componentize_version + `...`,
|
|
||||||
);
|
|
||||||
try {
|
try {
|
||||||
const { component } = await componentize({
|
const { component } = await componentize({
|
||||||
worldName: "plugin",
|
worldName: "plugin",
|
||||||
witPath: witDir,
|
witPath: witDir,
|
||||||
sourcePath: tempJs
|
jsSource: fs.readFileSync(tempJs, "utf8"),
|
||||||
|
optSize: true,
|
||||||
|
minify: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
fs.writeFileSync(outputPath, component);
|
fs.writeFileSync(outputPath, component);
|
||||||
@ -54,9 +51,7 @@ if (args.length < 2) {
|
|||||||
|
|
||||||
const entry = args[0];
|
const entry = args[0];
|
||||||
const output = args[1];
|
const output = args[1];
|
||||||
const wit =
|
const wit = args[2] || path.join(import.meta.dirname, "../wit/v0.1");
|
||||||
args[2] ||
|
|
||||||
path.join(import.meta.dirname, "../wit/v0.1");
|
|
||||||
|
|
||||||
buildPlugin(entry, output, wit).catch((err) => {
|
buildPlugin(entry, output, wit).catch((err) => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user