WMR

Installation

npm i --save-dev wmr
## or
yarn add -D wmr

You can also use npx wmr.

Setting up

First you'll need an index.html file containing your entry point, an example can be found in the demo app, as you can see we have a script of type module that points to our js file.

Now we can add a script to our package.json to spin up the dev environment and one to build for production:

{
	"scripts": {
		"start": "wmr",
		"build": "wmr build"
	}
}

Features

  • wmr is a single JavaScript file with no dependencies
  • import "deps" from npm without installation
  • Hot Module Replacement for JavaScript modules
  • on-the-fly smart bundling of dependencies
  • built-in JSX support without the overhead
  • hot-reloading for CSS (both imports and <link> tags)
  • import *.module.css for CSS Modules
  • serves static files
  • caches installed and built npm dependencies locally
  • auto-populates node_modules progressively based on usage
  • wmr build generates optimized bundles for production
  • no "entry points" or "pages" to configure

Hacking

git clone git@github.com:developit/wmr.git
cd wmr
npm i

# run the demo (no compile)
npm run demo

# build the single-file CLI:
npm run build
Description
👩‍🚀 The tiny all-in-one development tool for modern web apps.
Readme MIT 6.2 MiB
Languages
JavaScript 99.7%
HTML 0.2%
CSS 0.1%