Using httpolyglot to serve http/https over the same port for Webpack development server
Why?The React Chrome Extension Boilerplate need a https webpack server on development mode (Inject page), and we also need http for Window, Popup, Background features, I just don't want to open two webpack servers for that, so I made a tool, provide a easy way to achieve.
$ npm i --save-dev webpack-hot-middleware $ npm i --save-dev webpack-httpolyglot-server
var createWebpackServer = require('webpack-httpolyglot-server'); const server = createWebpackServer(config, serverOptions);
configcan be Array, it can use multiple config.
//as a prefix instead of
https://, but if you're making chrome extension (prefix:
chrome-extension://), it's not applicable.
This tool used
webpack-hot-middlewarefor enable hot module replacement.
devMiddlewareApply webpack-dev-middleware options.
hotMiddlewareApply webpack-hot-middleware options.
- The SSL keys is copied from webpack-dev-server.