https://github.com/jhen0409/webpack-httpolyglot-server
Using mscdex/httpolyglot to serve http/https over the same port for Webpack development server
https://github.com/jhen0409/webpack-httpolyglot-server
Last synced: 6 days ago
JSON representation
Using mscdex/httpolyglot to serve http/https over the same port for Webpack development server
- Host: GitHub
- URL: https://github.com/jhen0409/webpack-httpolyglot-server
- Owner: jhen0409
- License: mit
- Created: 2016-05-02T22:35:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-07-12T10:41:22.000Z (about 7 years ago)
- Last Synced: 2025-01-12T05:50:22.347Z (9 months ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 3
- Watchers: 4
- Forks: 13
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# webpack-httpolyglot-server
> Using [httpolyglot](https://github.com/mscdex/httpolyglot) to serve http/https over the same port for Webpack development server
## Why?
The [React Chrome Extension Boilerplate](https://github.com/jhen0409/react-chrome-extension-boilerplate) need a https webpack server on development mode ([Inject page](https://github.com/jhen0409/react-chrome-extension-boilerplate#development)), 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.
## Installation
```bash
$ npm i --save-dev webpack-hot-middleware
$ npm i --save-dev webpack-httpolyglot-server
```## Usage
#### CLI
Not yet.
#### Node
```js
var createWebpackServer = require('webpack-httpolyglot-server');const server = createWebpackServer(config, serverOptions);
```The `config` can be Array, it can use multiple config.
## Configuration
#### output.publicPath
Use `//` as a prefix instead of `http://` or `https://`, but if you're making chrome extension (prefix: `chrome-extension://`), it's not applicable.
#### `webpack-hot-middleware` [entry](https://github.com/glenjamin/webpack-hot-middleware#config)
This tool used `webpack-hot-middleware` for enable hot module replacement.
#### devMiddleware
Apply [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) options.
#### hotMiddleware
Apply [webpack-hot-middleware](https://github.com/glenjamin/webpack-hot-middleware) options.
## Credits
* The SSL keys is copied from [webpack-dev-server](https://github.com/webpack/webpack-dev-server/tree/master/ssl).
## License
[MIT](LICENSE.md)