2.0.0 • Published 8 years ago
@jamen/dev-server v2.0.0
@jamen/dev-server

Watch files, execute build scripts, and launch an auto-reloading dev server.
Install
npm i @jamen/dev-serverOr use npx
npx @jamen/dev-serverUsage
dev-server <entry> --watch <glob> <command>
Starts a server at entry and creates the given watchers.
$ dev-server dist --watch "src/**/*.js" "make js"
$ dev-server dist --watch "src/**/*.js" "cat $FILE"Use $FILE inside the command string to access the path.
Allows multiple watchers:
$ dev-server dist --watch "src/**/*.js" "make js" \
--watch "src/**/*.css" "make css" \
--watch "src/**/*.html" "make html"The flags available are:
--watch,-wSource files to watch and the command to execute.--port,-pChanges port of the server (defaults to3000).--host,-hChanges host of the server (defaults tolocalhost).--open,-oAutomatically opens page in browser (defaults tofalse).--gzip,-gCompress each file and serve as*.gz. (defaults tofalse).--ssl,-SEnables HTTPS with a key and cert (defaults tofalse).--cert,-CCertificate file for HTTPS (defaults tocert.pem).--key,-KKey file for HTTPS (defaults tokey.pem).--corsEnable CORS on the server (defaults tofalse).--ignore,-iArray of globs to exclude from--watch(defaults tonode_modulesand.git).
Without a directory to serve from, defaults to ./dist