Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fwilkerson/microenvi
Bundle, serve, and hot reload with one command
https://github.com/fwilkerson/microenvi
micro microbundle
Last synced: 3 months ago
JSON representation
Bundle, serve, and hot reload with one command
- Host: GitHub
- URL: https://github.com/fwilkerson/microenvi
- Owner: fwilkerson
- License: mit
- Created: 2018-01-24T04:53:17.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-17T01:35:01.000Z (over 5 years ago)
- Last Synced: 2024-07-18T15:32:48.180Z (4 months ago)
- Topics: micro, microbundle
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/microenvi
- Size: 299 KB
- Stars: 125
- Watchers: 3
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# microenvi
Microenvi is a zero configuration micro development environment. Bundle, serve, and hot reload with one command.
Transpile & bundle is done with [microbundle](https://github.com/developit/microbundle).
## Quick start
A simple hello world with microenvi and preact;
- first let's initialize our project `npm init --yes`
- then install preact `npm i -S preact`
- finally install microenvi `npm i -D microenvi`Now add the following to your package.json
```json
{
"main": "public/static/bundle.mjs",
"scripts": {
"dev": "microenvi"
}
}
```Create a `public` folder and add the following `index.html` to it.
```html
Microenvi
```
Finally create a `src` folder and add the following `index.js` to it.
```javascript
import {h, render} from 'preact';render(
Hello, Microenvi
, document.getElementById('root'));
```Start your dev environment by running... `npm run dev`
## CLI Options
```
Usage
$ microenvi [options]Available Commands
watch Bundle, serve, and reloadFor more info, run any command with the `--help` flag
$ microenvi watch --helpOptions
-v, --version Displays current version
--cwd Use an alternative working directory (default .)
--dir Specify the directory to watch (default public)
--external Specify external dependencies (default none)
--globals Specify global dependencies (default none)
--jsx A custom JSX pragma like React.createElement (default h)
--define Inline constants (default none)
--alias Remap imports from one module to another (default none)
--open Automatically open browser (default true)
--port Specify a port (default 3000)
--single Serve single page app (default false)
--ws Specify a port for the reload ws (default 3301)
-h, --help Displays this message
```The syntax for `--define` and `--alias` are as follows:
```bash
$ microenvi --define process.env.NODE_ENV=production,NUM=123,BOOL=true
# and
$ microenvi --alias react=preact-compat,react-dom=preact-compat
```