Skip to content

Commit

Permalink
Remove built-in favicon.ico
Browse files Browse the repository at this point in the history
Fixes #20
  • Loading branch information
thgh committed Jan 11, 2019
1 parent 7e966cb commit 120861a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@

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

## [1.0.0] - unreleased
### Removed
- Remove built-in `favicon.ico` #20

## [0.6.1] - 2018-12-23
### Added
- Add support for `rollup --watch` (Release http server on rollup reload)
Expand Down Expand Up @@ -50,7 +54,10 @@ All notable changes to `rollup-plugin-serve` will be documented in this file.
### Added
- Initial version

[Unreleased]: https://github.com/thgh/rollup-plugin-serve/compare/v0.1.0...HEAD
[Unreleased]: https://github.com/thgh/rollup-plugin-serve/compare/v1.0.0...HEAD
[1.0.0]: https://github.com/thgh/rollup-plugin-serve/compare/v0.6.1...v1.0.0
[0.6.1]: https://github.com/thgh/rollup-plugin-serve/compare/v0.5.0...v0.6.1
[0.5.0]: https://github.com/thgh/rollup-plugin-serve/compare/v0.4.2...v0.5.0
[0.4.2]: https://github.com/thgh/rollup-plugin-serve/compare/v0.4.1...v0.4.2
[0.4.1]: https://github.com/thgh/rollup-plugin-serve/compare/v0.4.0...v0.4.1
[0.4.0]: https://github.com/thgh/rollup-plugin-serve/compare/v0.3.0...v0.4.0
Expand Down
Binary file removed dist/favicon.ico
Binary file not shown.
15 changes: 2 additions & 13 deletions src/index.js
Expand Up @@ -36,22 +36,11 @@ export default function serve (options = { contentBase: '' }) {
response.writeHead(500)
response.end('500 Internal Server Error' +
'\n\n' + filePath +
'\n\n' + Object.keys(error).map(function (k) {
return error[k]
}).join('\n') +
'\n\n' + Object.values(error).join('\n') +
'\n\n(rollup-plugin-serve)', 'utf-8')
return
}
if (request.url === '/favicon.ico') {
filePath = resolve(__dirname, '../dist/favicon.ico')
readFile(filePath, function (error, content) {
if (error) {
notFound(response, filePath)
} else {
found(response, filePath, content)
}
})
} else if (options.historyApiFallback) {
if (options.historyApiFallback) {
var fallbackPath = typeof options.historyApiFallback === 'string' ? options.historyApiFallback : '/index.html'
readFileFromContentBase(options.contentBase, fallbackPath, function (error, content, filePath) {
if (error) {
Expand Down

0 comments on commit 120861a

Please sign in to comment.