Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何自定义favicon.ico #2798

Closed
laizhenhai88 opened this issue Jul 12, 2018 · 2 comments
Closed

如何自定义favicon.ico #2798

laizhenhai88 opened this issue Jul 12, 2018 · 2 comments

Comments

@laizhenhai88
Copy link

  • Node Version:v8.11.1
  • Egg Version:2.8.1
  • Plugin Name:egg-static
  • Plugin Version:egg默认自带
  • Platform:centos7
  • Mini Showcase Repository:

目的:希望通过egg-static插件,提供静态网页服务
1、配置config.default.js

  config.static = {
    prefix: '/',
    dir: path.join(appInfo.baseDir, 'dist')
  };

2、dist文件夹下放置图片 favicon.ico
3、npm run dev或者npm start启动
4、访问http://ip/favicon.ico 得到的图标始终是egg默认的图标

好像是并没有经过egg-static插件处理,请问如何配置可以实现自定义ico?

@egg-bot
Copy link

egg-bot commented Jul 12, 2018

Translation of this issue:


How to customize favicon.ico

  • Node Version: v8.11.1
  • Egg Version: 2.8.1
  • Plugin Name:egg-static
  • Plugin Version:egg comes with default
  • Platform: centos7
  • Mini Showcase Repository:

Purpose: I hope to provide static web services through the egg-static plugin.
1, configure config.default.js

  Config.static = {
    Prefix: '/',
    Dir: path.join(appInfo.baseDir, 'dist')
  };

2, put the picture under the dist folder favicon.ico
3, npm run dev or npm start start
4. The icon you get at http://ip/favicon.ico is always the default icon for egg.

It seems that it has not been processed by the egg-static plugin. How can I configure custom ico?

@atian25
Copy link
Member

atian25 commented Jul 12, 2018

https://github.com/eggjs/egg/blob/master/config/config.default.js#L168

@atian25 atian25 closed this as completed Jul 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants