Skip to content

Commit be8e56d

Browse files
fix: npm run build failed due to web build error (#3005)
Co-authored-by: Max Graey <maxgraey@gmail.com>
1 parent 40037f5 commit be8e56d

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

scripts/build-web.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export function buildWeb() {
88
const pkg = JSON.parse(fs.readFileSync(join(__dirname, "../package-lock.json")));
99

1010
const mainVersion = pkg.version;
11-
const binaryenVersion = pkg.dependencies.binaryen.version;
12-
const longVersion = pkg.dependencies.long.version;
11+
const binaryenVersion = pkg.packages["node_modules/binaryen"].version || pkg.dependencies.binaryen.version;
12+
const longVersion = pkg.packages["node_modules/long"].version || pkg.dependencies.long.version;
1313

1414
const distUrl = mainVersion === "0.0.0" ? `./` : `https://cdn.jsdelivr.net/npm/assemblyscript@${mainVersion}/dist/`;
1515
const binaryenUrl = `https://cdn.jsdelivr.net/npm/binaryen@${binaryenVersion}/index.js`;

scripts/build.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ const webPlugin = {
182182

183183
const duration = Date.now() - startTime;
184184
console.log(`${time()} - web - ${stdoutColors.green("SUCCESS")} (no errors, ${duration} ms)`);
185-
process.exitCode = 0;
186185
} catch (e) {
187186
const duration = Date.now() - startTime;
188187
console.error(e);
@@ -256,7 +255,6 @@ function buildDefinitions() {
256255

257256
const duration = Date.now() - startTime;
258257
console.log(`${time()} - dts - ${stdoutColors.green("SUCCESS")} (no errors, ${duration} ms)`);
259-
process.exitCode = 0;
260258
} catch (e) {
261259
const duration = Date.now() - startTime;
262260
console.error(e);

0 commit comments

Comments
 (0)