diff --git a/src/web.rs b/src/web.rs index ecd2cd8..c9cde25 100644 --- a/src/web.rs +++ b/src/web.rs @@ -425,6 +425,8 @@ impl Service { let (p, mime) = match e.file_name().to_str() { Some(n) if n == "index.html" => ("/".to_owned(), mime::TEXT_HTML), Some(n) if n.ends_with(".html") => (format!("/{}", n), mime::TEXT_HTML), + Some(n) if n.ends_with(".ico") => (format!("/{}", n), + "image/vnd.microsoft.icon".parse().unwrap()), Some(n) if n.ends_with(".js") => (format!("/{}", n), mime::TEXT_JAVASCRIPT), Some(n) if n.ends_with(".map") => (format!("/{}", n), mime::TEXT_JAVASCRIPT), Some(n) if n.ends_with(".png") => (format!("/{}", n), mime::IMAGE_PNG), diff --git a/ui-src/favicon.ico b/ui-src/favicon.ico new file mode 100644 index 0000000..08e133d Binary files /dev/null and b/ui-src/favicon.ico differ diff --git a/ui-src/index.js b/ui-src/index.js index e59cfa3..6369be4 100644 --- a/ui-src/index.js +++ b/ui-src/index.js @@ -5,6 +5,8 @@ // TODO: style: no globals? string literals? line length? fn comments? // TODO: live updating. +import './favicon.ico'; + import 'jquery-ui/themes/base/button.css'; import 'jquery-ui/themes/base/core.css'; import 'jquery-ui/themes/base/datepicker.css'; diff --git a/webpack/base.config.js b/webpack/base.config.js index 0546190..14f67d5 100644 --- a/webpack/base.config.js +++ b/webpack/base.config.js @@ -29,6 +29,16 @@ module.exports = (env, args) => { }, { test: /\.png$/, use: ['file-loader'], + }, { + test: /\.ico$/, + use: [ + { + loader: 'file-loader', + options: { + name: '[name].[ext]' + } + } + ] }, { // Load css and then in-line in head test: /\.css$/,