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

laizhenhai88 opened this issue Jul 12, 2018 · 2 comments

如何自定义favicon.ico #2798

laizhenhai88 opened this issue Jul 12, 2018 · 2 comments


Copy link

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


  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默认的图标


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?

Copy link

atian25 commented Jul 12, 2018

@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
None yet
None yet

No branches or pull requests

3 participants