0.2.0 • Published 6 years ago

@ngirl/nom-livereload v0.2.0

Weekly downloads
1
License
BSD-3-Clause
Repository
-
Last release
6 years ago

nom-livereload

A custom, pluggable server and client software for simple setup and forget of hot module reloads with modern web application 1 development.

  1. See software requirements.

Software requirements

  • Modern JavaScript (ES2015 with JavaScript Modules)
  • CSS Level 3+
  • HTML 5.

Usage

A local bin script -- nom-reload ~and nom-rpc-clear-cache~ -- can be installed either as a local or global node module script with npm install -g.

nom-reload ws://localhost:9090
npm install git+https://git.imbue.studio/ngirl/nom-livereload.git#latest

Import module

import NomLiveReload from 'nom-livereload';
NomLiveReload(url, opts);

Development

  1. ~One-time~ npm package link. This must be ran from this package's parent directory.
# cd /Projects/naughty.im.git/src/app/modules/nom-livereload
npm link
  1. ~One-time~ jspm package link. This must be ran from your parent project root.
# cd /Projects/naughty.im.git/
jspm link src/app/modules/nom-livereload asshats:ngirl/nom-livereload
  1. Every modification to the source files in the lib directory require linking this module from the root project directory, i.e.: ngirl/www.
npm link @ngirl/nom-livereload
  1. Last, but not least, your project's web application must be restarted, i.e.: pm2 restart ndev_${appName}.

IMPORTANT: Local modifications made to this module's package.json require a re-link; see the depicted BASH(https://en.wikipedia.org/wiki/Bash_(Unix_shell)) shell commands outlined in steps one (1) and two (2).

Testing

npm run test

Distribution

Check the dist directory for the build results.

npm run build

TODO

TODO.md

Roadmap

I wish for supporting hot module reloading of server-side Node.JS applications some day, too.

Projects using nom-livereload

Reference Documents

  1. http://webpack.github.io/docs/hot-module-replacement.html
  2. https://github.com/glenjamin/webpack-hot-middleware
  3. http://pm2.keymetrics.io/docs/usage/pm2-api/
  4. https://github.com/jlongster/monkey-hot-loader
  5. https://github.com/jlongster/backend-with-webpack