I use the html-webpack-plugin, along with the html-webpack-template, which provides support for "injecting" things onto the window related to the html served up by the html-webpack-plugin in the webpack-dev-server.
In this case, I'm actually generating the 'uiContext' below, from a require of a sibling module. What I'd like to do is watch that module for changes, then upon changes, tell the webpack-dev-server to reload (with the changes to uiContext).
Thoughts?
var HtmlWebpackPlugin = require('html-webpack-plugin');
var htmlWebpackTemplate = require('html-webpack-template');
var uiContext = require('./server/ui-context');
// ...
plugins: [
new HtmlWebpackPlugin({
template: htmlWebpackTemplate,
window: {
uiContext
}
}),