Skip to content

如何自定义favicon.ico #2798

@laizhenhai88

Description

@laizhenhai88
  • 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?

Activity

egg-bot

egg-bot commented on Jul 12, 2018

@egg-bot

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

atian25 commented on Jul 12, 2018

@atian25
Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @atian25@laizhenhai88@egg-bot

        Issue actions

          如何自定义favicon.ico · Issue #2798 · eggjs/egg