rollup-plugin-serve
Advanced tools
Comparing version
@@ -5,2 +5,9 @@ # Changelog | ||
## [1.0.1] - 2019-01-27 | ||
### Added | ||
- Add Intellisense support #34 | ||
### Fixed | ||
- Set minimum version for `mime` package | ||
## [1.0.0] - 2019-01-11 | ||
@@ -7,0 +14,0 @@ ### Fixed |
@@ -14,2 +14,6 @@ 'use strict'; | ||
/** | ||
* Serve your rolled up bundle like webpack-dev-server | ||
* @param {ServeOptions|string|string[]} options | ||
*/ | ||
function serve (options) { | ||
@@ -146,2 +150,23 @@ if ( options === void 0 ) options = { contentBase: '' }; | ||
/** | ||
* @typedef {Object} ServeOptions | ||
* @property {boolean} [open=false] Launch in browser (default: `false`) | ||
* @property {string} [openPage=''] Page to navigate to when opening the browser. Will not do anything if `open` is `false`. Remember to start with a slash e.g. `'/different/page'` | ||
* @property {boolean} [verbose=true] Show server address in console (default: `true`) | ||
* @property {string|string[]} [contentBase=''] Folder(s) to serve files from | ||
* @property {string|boolean} [historyApiFallback] Path to fallback page. Set to `true` to return index.html (200) instead of error page (404) | ||
* @property {string} [host='localhost'] Server host (default: `'localhost'`) | ||
* @property {number} [port=10001] Server port (default: `10001`) | ||
* @property {ServeOptionsHttps} [https=false] By default server will be served over HTTP (https: `false`). It can optionally be served over HTTPS | ||
* @property {{[header:string]: string}} [headers] Set headers | ||
*/ | ||
/** | ||
* @typedef {Object} ServeOptionsHttps | ||
* @property {string|Buffer|Buffer[]|Object[]} key | ||
* @property {string|Buffer|Array<string|Buffer>} cert | ||
* @property {string|Buffer|Array<string|Buffer>} ca | ||
* @see https.ServerOptions | ||
*/ | ||
module.exports = serve; |
@@ -10,2 +10,6 @@ import { readFile } from 'fs'; | ||
/** | ||
* Serve your rolled up bundle like webpack-dev-server | ||
* @param {ServeOptions|string|string[]} options | ||
*/ | ||
function serve (options) { | ||
@@ -142,2 +146,23 @@ if ( options === void 0 ) options = { contentBase: '' }; | ||
/** | ||
* @typedef {Object} ServeOptions | ||
* @property {boolean} [open=false] Launch in browser (default: `false`) | ||
* @property {string} [openPage=''] Page to navigate to when opening the browser. Will not do anything if `open` is `false`. Remember to start with a slash e.g. `'/different/page'` | ||
* @property {boolean} [verbose=true] Show server address in console (default: `true`) | ||
* @property {string|string[]} [contentBase=''] Folder(s) to serve files from | ||
* @property {string|boolean} [historyApiFallback] Path to fallback page. Set to `true` to return index.html (200) instead of error page (404) | ||
* @property {string} [host='localhost'] Server host (default: `'localhost'`) | ||
* @property {number} [port=10001] Server port (default: `10001`) | ||
* @property {ServeOptionsHttps} [https=false] By default server will be served over HTTP (https: `false`). It can optionally be served over HTTPS | ||
* @property {{[header:string]: string}} [headers] Set headers | ||
*/ | ||
/** | ||
* @typedef {Object} ServeOptionsHttps | ||
* @property {string|Buffer|Buffer[]|Object[]} key | ||
* @property {string|Buffer|Array<string|Buffer>} cert | ||
* @property {string|Buffer|Array<string|Buffer>} ca | ||
* @see https.ServerOptions | ||
*/ | ||
export default serve; |
{ | ||
"name": "rollup-plugin-serve", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Serve your rolled up bundle", | ||
@@ -36,3 +36,3 @@ "main": "dist/index.cjs.js", | ||
"dependencies": { | ||
"mime": "2", | ||
"mime": ">=2.0.3", | ||
"opener": "1" | ||
@@ -39,0 +39,0 @@ }, |
18545
17.31%288
19.01%+ Added
- Removed
Updated