How to create and compile a standalone library?

In early versions of the toolchain I was able to do moon build --target wasm-gc to generate a generic Wasm library I could link into other Wasm modules or consume from any Wasm runtime. Now I get error: no package need to be linked in the project

I understandably don’t yet see any documentation on this use case. Could someone give me instructions, starting from scratch, a brand new library project, and how to build it for use outside Moonbit?

Also, it’s unclear how to include (or exclude) the standard library.

to generate a generic Wasm library

You can refer to The MoonBit Update——0401

Also, it’s unclear how to include (or exclude) the standard library.

Currently, core will be linked by default, if you want to make it more clear you can use --std|--nostd flag for moon check|build|test, for example:

moon build --std
moon build --nostd