Skip to content

Commit 0593bfa

Browse files
committed
v1.1.0
1 parent 2c4c239 commit 0593bfa

File tree

5 files changed

+21
-13
lines changed

5 files changed

+21
-13
lines changed

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
All notable changes to `rollup-plugin-serve` will be documented in this file.
44

5+
## [1.1.0] - 2020-11-01
6+
### Added
7+
- Add `onListening` hook #69 @filoxo
8+
- Show error message when port is in use #60 @jaeh
9+
10+
## [1.0.4] - 2020-08-28
11+
### Added
12+
- Add `mimeTypes` option #58 @GerardRodes
13+
14+
### Fixed
15+
- Allow opening the browser even when verbose mode is disabled #64 @Richienb
16+
517
## [1.0.3] - 2020-07-21
618
### Fixed
719
- Fix path.normalize error on Windows

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rollup-plugin-serve",
3-
"version": "1.0.4",
3+
"version": "1.1.0",
44
"description": "Serve your rolled up bundle",
55
"main": "dist/index.cjs.js",
66
"module": "dist/index.es.js",

rollup.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import buble from '@rollup/plugin-buble'
33
export default {
44
input: 'src/index.js',
55
output: [
6-
{ file: 'dist/index.cjs.js', format: 'cjs' },
6+
{ file: 'dist/index.cjs.js', format: 'cjs', exports: 'default' },
77
{ file: 'dist/index.es.js', format: 'esm' }
88
],
99
plugins: [buble()],

src/index.js

+4-11
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,10 @@ function serve (options = { contentBase: '' }) {
7474
}
7575

7676
// If HTTPS options are available, create an HTTPS server
77-
if (options.https) {
78-
server = createHttpsServer(options.https, requestListener)
79-
server.listen(options.port, options.host, () => {
80-
options.onListening(server)
81-
})
82-
} else {
83-
server = createServer(requestListener)
84-
server.listen(options.port, options.host, () => {
85-
options.onListening(server)
86-
})
87-
}
77+
server = options.https
78+
? createHttpsServer(options.https, requestListener)
79+
: createServer(requestListener)
80+
server.listen(options.port, options.host, () => options.onListening(server))
8881

8982
// Assemble url for error and info messages
9083
const url = (options.https ? 'https' : 'http') + '://' + (options.host || 'localhost') + ':' + options.port

test/rollup.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ export default {
1919
file: 'dest.js',
2020
format: 'cjs'
2121
},
22+
watch: {
23+
clearScreen: false,
24+
},
2225
plugins: [
2326
serve({
2427
open: true,

0 commit comments

Comments
 (0)