Skip to content

favicon not being deployed/displayed #2232

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

Closed
peterennis opened this issue Sep 19, 2016 · 11 comments
Closed

favicon not being deployed/displayed #2232

peterennis opened this issue Sep 19, 2016 · 11 comments

Comments

@peterennis
Copy link

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

@jbeckton
Copy link

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

@peterennis
Copy link
Author

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

@peterennis
Copy link
Author

This also seems related: #2202

@jbeckton
Copy link

jbeckton commented Sep 20, 2016

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

@ustaDAH
Copy link

ustaDAH commented Sep 21, 2016

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

@pauldubois777
Copy link

pauldubois777 commented Sep 21, 2016

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

@nmorado
Copy link

nmorado commented Sep 21, 2016

This works! Thanks

@filipesilva
Copy link
Contributor

Dupe of #2137

@ustaDAH
Copy link

ustaDAH commented Sep 22, 2016

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).

@JScafidi616
Copy link

It Works! Thanks!

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants