UNPKG

miru

Version:

web development server for bundlers and/or static files, parses terminal and DOM errors ( inline sourcemaps supported )

72 lines (51 loc) 4.2 kB
Usage: miru [options] Options: -p, --path <dir> Specify path (current directory by default) Usually path to public directory. This is also the path where miru creates "miru-connect.js" which you should <script src="miru-connect.js"> on your html page to enable live reloads and error reporting directly within the page/browser. -w, --watch [ <command>, <file> ] Specify watch command and target file bundle. miru-connect.js refreshes corresponding <link href="file.css"> or reloads <script src="file.js"> tags on the html page where <script src="miru-connect.js"> is loaded. "miru-connect.js" is created inside the --path directory when miru starts -t, --targets <file> Add arbitrary target files not linked to a watch process. When these files change, they will be assumed as if they have been successfully built and will be emitted to miru-connect.js. styles ( *.css ) are attempted to refresh if the basename is found on a link tag inside the DOM. scripts ( *.js ) and all other files trigger a page reload. miru-connect.js will listen for DOM Errors -- and if the basename of the source file of the error matches a file in --targets then it will pass the error back to the miru.js sever for parsing. The parsing is done by wooster and the result is sent back to the client. The parsed error output is then rendered on the screen for easier debugging. Inline source maps are supported: If the target file includes inline source maps then the parsed output includes the source map as well. -r, --reload Always force a reload when a change event is emitted. This disables css link.href quick refreshing. -f, --files <file> Watch arbitray files for changes and execute commands. -e, --execute <command> Execute commands when --files have changed. '$evt' and '$file' strings in the <command> parameter are substituted accordingly. eg: miru -f package.json -e 'echo $evt: $file' -v, --verbose Enable verbose mode -V, --version Display miru version -h, --help Display help information (this text) Terminal Commands: miru.js listens for lined stdio input devices prints a numbered list of connected client/device information logs <number> list console.log output of <number> client ( or all clients if undefined ) recovery prints recovery watcher ( if watcher exits ( should not happen, fix your watcher script ) ) previous prints out previous error lan, ip, address prints out LAN address ( use this address to connect from other devices ) watchers prints watcher commands and targets targets prints only target bundles error prints active watcher errors ( or empty if nothing is active ) pesticide <bool> enable or disable pesticide ( css debugger ) on all connected clients