WMR assumes your code is written to run in a browser environment. In general, you can pretend WMR doesn't exist and just code as if you weren't using any tooling (except that you can import npm packages and CSS, write JSX/TypeScript, etc).
# install
npm i wmr
# start
wmr start
# generate a production build
wmr build
# serve that build for production
wmr serve --http2