Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
18a970541d | ||
|
|
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"
|
||||
},
|
||||
"dependencies": {
|
||||
"@bytecodealliance/componentize-js": "^0.21.0",
|
||||
"esbuild": "^0.28.0"
|
||||
"componentize-qjs": "^0.4.5",
|
||||
"esbuild": "^0.28.2"
|
||||
},
|
||||
"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
|
||||
|
||||
import * as esbuild from "esbuild";
|
||||
import {
|
||||
componentize,
|
||||
version as componentize_version,
|
||||
} from "@bytecodealliance/componentize-js";
|
||||
import { componentize } from "componentize-qjs";
|
||||
import * as path from "node:path";
|
||||
import * as fs from "node:fs";
|
||||
|
||||
@ -22,14 +19,14 @@ async function buildPlugin(entryPath, outputPath, witDir) {
|
||||
external: ["pumpkin:plugin/*"],
|
||||
});
|
||||
|
||||
console.log(
|
||||
`2. Running through \`componentize-js\` ` + componentize_version + `...`,
|
||||
);
|
||||
console.log(`2. Running through \`componentize-qjs\`...`);
|
||||
try {
|
||||
const { component } = await componentize({
|
||||
worldName: "plugin",
|
||||
witPath: witDir,
|
||||
sourcePath: tempJs
|
||||
jsSource: fs.readFileSync(tempJs, "utf8"),
|
||||
optSize: true,
|
||||
minify: true,
|
||||
});
|
||||
|
||||
fs.writeFileSync(outputPath, component);
|
||||
@ -54,9 +51,7 @@ if (args.length < 2) {
|
||||
|
||||
const entry = args[0];
|
||||
const output = args[1];
|
||||
const wit =
|
||||
args[2] ||
|
||||
path.join(import.meta.dirname, "../wit/v0.1");
|
||||
const wit = args[2] || path.join(import.meta.dirname, "../wit/v0.1");
|
||||
|
||||
buildPlugin(entry, output, wit).catch((err) => {
|
||||
console.error(err);
|
||||
|
||||
2
wit
2
wit
@ -1 +1 @@
|
||||
Subproject commit 4d7a501943bb99f0f02a339128833f58ed37d0cc
|
||||
Subproject commit 39bf330fa6aefc91c8ac61bd07d0fdbd5a5b95ac
|
||||
Loading…
Reference in New Issue
Block a user