npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

webpack-hot-plugin

v0.0.3

Published

Webpack hot reloading you can attach to your own server

Downloads

15

Readme

Webpack Hot plugin

Webpack hot reloading using only Webpack Hot plugin This allows you to add hot reloading into an existing server without webpack-dev-server.

This module is only concerned with the mechanisms to connect a browser client to a webpack server & receive updates. It will subscribe to changes from the server and execute those changes using webpack's HMR API. Actually making your application capable of using hot reloading to make seamless changes is out of scope, and usually handled by another library.

npm version CircleCIcodecovMIT Licensed

Installation & Usage

See example/ for an example of usage.

First, install the npm module.

npm install --save webpack-hot-plugin

Next, enable hot reloading in your webpack config:

  1. Add the following plugins to the plugins array:

  2. const WebpackHotPlugin = require('webpack-hot-plugin');

    plugins: [
        new WebpackHotPlugin ({options}),
    ]

    Occurence ensures consistent build hashes, hot module replacement is somewhat self-explanatory, no errors is used to handle errors more cleanly.

And you're all set!

Documentation

More to come soon, you'll have to mostly rely on the example for now.

Config

Client

Configuration options can be passed to the client by adding querystring parameters to the path in the webpack config.

options:

  • path - The path which the middleware is serving the event stream on
  • name - Bundle name, specifically for multi-compiler mode
  • timeout - The time to wait after a disconnection before attempting to reconnect
  • overlay - Set to false to disable the DOM-based client-side overlay.
  • reload - Set to true to auto-reload the page when webpack gets stuck.
  • noInfo - Set to true to disable informational console logging.
  • quiet - Set to true to disable all console logging.
  • dynamicPublicPath - Set to true to use webpack publicPath as prefix of path. (We can set __webpack_public_path__ dynamically at runtime in the entry point, see note of output.publicPath)
  • autoConnect - Set to false to use to prevent a connection being automatically opened from the client to the webpack back-end - ideal if you need to modify the options using the setOptionsAndConnect function
  • ansiColors - An object to customize the client overlay colors as mentioned in the ansi-html-community package.
  • overlayStyles - An object to let you override or add new inline styles to the client overlay div.
  • overlayWarnings - Set to true to enable client overlay on warnings in addition to errors.

Note: Since the ansiColors and overlayStyles options are passed via query string, you'll need to uri encode your stringified options like below:

var ansiColors = {
  red: '00FF00' // note the lack of "#"
};
var overlayStyles = {
  color: '#FF0000' // note the inclusion of "#" (these options would be the equivalent of div.style[option] = value)
};


plugins: [
    new WebpackHotPlugin ({ansiColors,overlayStyles}),
]

 

author : 姚观寿 (yao guan shou)