From d1e08b719888163aae1438da467f3d09f181045f Mon Sep 17 00:00:00 2001 From: Johannes Gloeckle Date: Thu, 7 Mar 2024 21:32:21 +0100 Subject: [PATCH] documentation: Extend README on how to build `.wasm` file It might not be obvious for everyone how to build a `.wasm` file to be used as a plugin for `dprint`. Thus, extending the `README.md` by a brief section. --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index b5b584d..24006eb 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,19 @@ Markdown formatting plugin for dprint. This uses the [pulldown-cmark](https://github.com/raphlinus/pulldown-cmark) parser for markdown. + +## Building `.wasm` File as Plugin for `dprint` + +If you want to build a `.wasm` file to be used as a plugin for `dprint` the following command can be used: + +``` +cargo build --release --target=wasm32-unknown-unknown --features="wasm" +``` + +The `--release` parameter is optional. The generated `.wasm` file can then be found in the target directory. + +Note that this requires adding `wasm32` as a Rust target. This can be done using the following command: + +``` +rustup target add wasm32-unknown-unknown +```