The build flags are incorrect (-o instead of -b, -b instead of -d)
Sakari369 opened this issue ยท 3 comments
Sakari369 commented
The build flags specified in the examples are incorrect for asc version 0.20.6.
Currently the build scripts use "-b output.wasm" and "-d build/optimized.d.ts"
The correct flags are "-o output.wasm" and "-b esm"
Here is a diff:
diff --git a/mandelbrot/package.json b/mandelbrot/package.json
index 5b6c6b9..5165d15 100644
--- a/mandelbrot/package.json
+++ b/mandelbrot/package.json
@@ -4,8 +4,8 @@
"license": "Apache-2.0",
"private": true,
"scripts": {
- "asbuild:untouched": "asc assembly/index.ts -b build/untouched.wasm -t build/untouched.wat --use Math=JSMath --runtime stub --importMemory --sourceMap --debug --measure",
- "asbuild:optimized": "asc assembly/index.ts -b build/optimized.wasm -t build/optimized.wat -d build/optimized.d.ts --use Math=JSMath --runtime stub -O3 --importMemory --sourceMap --measure",
+ "asbuild:untouched": "asc assembly/index.ts -o build/untouched.wasm -t build/untouched.wat --use Math=JSMath --runtime stub --importMemory --sourceMap --debug --measure",
+ "asbuild:optimized": "asc assembly/index.ts -o build/optimized.wasm -t build/optimized.wat -b esm --use Math=JSMath --runtime stub -O3 --importMemory --sourceMap --measure",
"asbuild": "npm run asbuild:untouched && npm run asbuild:optimized",
"start": "npx serve"
},
sebpiq commented
Ping ๐ ! Same here ๐ I'm happy opening a pull request if someone tells me that there's nothing else to modify
MaxGraey commented
PR are welcomed! Better use asconfig
like in n-body instead asc options:
https://github.com/AssemblyScript/examples/blob/main/n-body/asconfig.json