0.0.6 • Published 5 years ago

cnd-webpack-hot-server v0.0.6

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 years ago

cnd-webpack-hot-server

Enable webpack hot reloading for cloud native development (CND). This enables other tools like React Hot Loader to tweak React components in real time in your cloud native environment.

It uses the popular express middlewares webpack-dev-middleware and webpack-hot-middleware under the hood.

Getting Started

Install the server module:

yarn add cnd-webpack-hot-server --dev

Usage

With the CLI

If your webpack.config.js is on the root directory of your CND environment, run:

cnd exec node_modules/cnd-webpack-hot-server/cnd-webpack-hot-server.js

You can also the path of your config file:

cnd exec -- node_modules/cnd-webpack-hot-server/cnd-webpack-hot-server.js --config path/to/webpack.config.js

See CND

With NPM Scripts

NPM package.json scripts are a convenient and useful means to run locally installed binaries without having to be concerned about their full paths. Simply define a script as such:

"scripts": {
  "watch": "node node_modules/cnd-webpack-hot-server/cnd-webpack-hot-server.js"
}

And run the following in your CND environment:

cnd exec yarn run watch

The Result

This will start a server instance in your container and begin listening for connections from localhost on the default port 35729.

License

Apache-2.0