A simple build tool for AssemblyScript projects, similar to cargo, etc.
asb [entry file] [options] -- [args passed to asc]
AssemblyScript greater than v0.14.4 provides a asconfig.json configuration file that can be used to describe the options for building a project. ASBuild uses this and some adds defaults to create an easier CLI interface.
project/
package.json
asconfig.json
assembly/
index.ts
build/
release/
project.wasm
debug/
project.wasm
- If no entry file passed and no
entryfield is inasconfig.json,project/assembly/index.tsis assumed. asconfig.jsonallows for options for different compile targets, e.g. release, debug, etc.ascdefaults to the release target.- The default build directory is
./build, and artifacts are placed at./build/<target>/packageName.wasm.
If a workspace field is added to a top level asconfig.json file, then each path in the array is built and placed into the top level outDir.
For example,
asconfig.json:
{
"workspaces": ["a", "b"]
}Running asb in the directory below will use the top level build directory to place all the binaries.
project/
package.json
asconfig.json
a/
asconfig.json
assembly/
index.ts
b/
asconfig.json
assembly/
index.ts
build/
release/
a.wasm
b.wasm
debug/
a.wasm
b.wasm
To see an example in action check out the test workspace