Skip to content

Commit b958bb4

Browse files
fix: npm run build failed due to web build error
1 parent 40037f5 commit b958bb4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-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;
12+
const longVersion = pkg.packages["node_modules/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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ 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;
185+
if (!process.exitCode) process.exitCode = 0;
186186
} catch (e) {
187187
const duration = Date.now() - startTime;
188188
console.error(e);
@@ -256,7 +256,7 @@ function buildDefinitions() {
256256

257257
const duration = Date.now() - startTime;
258258
console.log(`${time()} - dts - ${stdoutColors.green("SUCCESS")} (no errors, ${duration} ms)`);
259-
process.exitCode = 0;
259+
if (!process.exitCode) process.exitCode = 0;
260260
} catch (e) {
261261
const duration = Date.now() - startTime;
262262
console.error(e);

0 commit comments

Comments
 (0)