Skip to content

favicon not being deployed/displayed #2232

Closed

Description

@peterennis

Microsoft Windows Version 10.0.14393 2016 Microsoft Corporation. All rights reserved.

C:\Users\Peter Ennis>ng version
angular-cli: 1.0.0-beta.14
node: 6.6.0
os: win32 x64

I have tried a number of options in the index.html file to get
the favicon showing but without success.

The localhost site and direct github link show the favicon.

The site is a masked redirect from godaddy to github gh-pages
using the ng github-pages:deploy

Some examples of favicon testing that fail, but have worked in the past
with other deploy methods:

<head>
  <meta charset="utf-8">
  <title>Adaept</title>
  <base href="/adaept/">

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="https://adaept.github.io/adaept/favicon.ico">
  <!-- <link rel="icon" sizes="16x16 32x32" href="favicon.ico?v=2">
       <link rel="icon" type="image/x-icon" href="favicon.ico"> -->

When I look in the dist folder and parent there is no favicon.ico file available to be deployed.

Does the file have to be manually copied? I would expect deploy to take care of this.

capture68

Activity

  1. jbeckton commented on Sep 19, 2016

    @jbeckton

    I had to put mine in the assets folder and change the path in the index.html

  2. peterennis commented on Sep 20, 2016

    @peterennis
    Author

    I could not find any assets folder in the system. Starting with new ...
    Here: #713
    is another reference from @ustaDAH

  3. peterennis commented on Sep 20, 2016

    @peterennis
    Author

    This also seems related: #2202

  4. jbeckton commented on Sep 20, 2016

    @jbeckton

    You have to create an assets folder in your src folder. By convention the CLI will copy it for you to /dist.

    The webpack version of the CLI replaced the public folder for one named assets

  5. ustaDAH commented on Sep 21, 2016

    @ustaDAH

    @jbeckton @peterennis yes that (creation of /src/assets) worked.

  6. pauldubois777 commented on Sep 21, 2016

    @pauldubois777

    How do we find out if the team still wants to have the favicon.ico file copied during build?
    It appears this might have been lost in Pull Request 2056

    If it should still do this, I think the following will fix it...

    In packages\angular-cli\models\webpack-build-common.ts update the plugins object to include a copy of the favicon.ico file:

          new CopyWebpackPlugin([
            {
              context: path.resolve(appRoot, appConfig.assets),
              from: { glob: '**/*', dot: true },
              ignore: [ '.gitkeep' ],
              to: path.resolve(projectRoot, appConfig.outDir, appConfig.assets)
            }, {
    >>        from: path.resolve(projectRoot, appConfig.root, 'favicon.ico'),
    >>        to: path.resolve(projectRoot, appConfig.outDir)
            }
          ])
    

    If someone wants to do a pull request to fix this, please go ahead. There is too much overhead for me to follow the developers guidelines just for this simple fix. I don't have the time right now. Thanks!

    Paul

  7. nmorado commented on Sep 21, 2016

    @nmorado

    This works! Thanks

  8. filipesilva commented on Sep 22, 2016

    @filipesilva
    Contributor

    Dupe of #2137

  9. ustaDAH commented on Sep 22, 2016

    @ustaDAH

    I'd be tempted to rather have favicon.ico in the assets folder and change the url in the index.html accordingly. (And of course also change ng new ... to generate seed sources as such).

  10. JScafidi616 commented on Feb 21, 2018

    @JScafidi616

    It Works! Thanks!

  11. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  12. locked and limited conversation to collaborators on Sep 7, 2019
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

      Issue actions