From 120861af7547dc22f8eb1c7eef32f54b81a72e9d Mon Sep 17 00:00:00 2001 From: Thomas Ghysels Date: Fri, 11 Jan 2019 18:16:24 +0700 Subject: [PATCH] Remove built-in favicon.ico Fixes #20 --- CHANGELOG.md | 9 ++++++++- dist/favicon.ico | Bin 318 -> 0 bytes src/index.js | 15 ++------------- 3 files changed, 10 insertions(+), 14 deletions(-) delete mode 100644 dist/favicon.ico diff --git a/CHANGELOG.md b/CHANGELOG.md index 82c7152..a85ff8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) @@ -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 diff --git a/dist/favicon.ico b/dist/favicon.ico deleted file mode 100644 index fbfdbe7320732b886d4057985650352bec74f117..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 318 ycmZQzU<5(|0RbS%!l1#(z#zuJz@P!d0zj+)#2|4HXaJKC0wf0pyJ3uxNdo{)UIHHg diff --git a/src/index.js b/src/index.js index 31f47c6..8c2f1d9 100644 --- a/src/index.js +++ b/src/index.js @@ -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) {