To build and run in debug mode, execute:
wasm-pack build --target no-modules --dev && cargo run --addr 127.0.0.1:2080
Visit http://localhost:2080
for the website.
To build release, execute:
wasm-pack build --target no-modules && cargo build --release
The language is controlled by MAOMI_I18N_LOCALE
environment variable while compilation. Currently available languages:
- default (English);
zh_CN
for Simplified Chinese.
Specify MAOMI_I18N_LOCALE=
if there is compilation error about missing the translation file.
Server-side rendering is disabled by default.
To enable it, use feature server-side-rendering
while compilation.
wasm-pack build --target no-modules --features server-side-rendering && cargo build --release --features server-side-rendering
It seems that there might hit some rust compiler bugs. If so, disable the incremental compilation through CARGO_INCREMENTAL=0
.
Supported compile-time environment variables:
MAOMI_PATH_PREFIX
the path prefix in URL, e.g./maomi/en_US
.