Skip to content

FaviconsWebpackPlugin won't generate icons, inject them into head #3068

@schoenwaldnils

Description

@schoenwaldnils
  • I have searched the issues of this repository and believe that this is not a duplicate.

my config (tidied)

// next.config.js
import HtmlWebpackPlugin from 'html-webpack-plugin';
import FaviconsWebpackPlugin from 'favicons-webpack-plugin';

module.exports = {
  webpack: (config, { dev }) => {
    config.plugins.push(
      new FaviconsWebpackPlugin({
        logo: './static/assets/images/favicon.png',
        inject: true,
      }),
      new HtmlWebpackPlugin(),
    );

    return config;
  },
};
// pages/_document.js
import React from 'react';
import Document, { Head, Main, NextScript } from 'next/document';

export default class SmediaDocument extends Document {
  render() {
    return (
      <html lang="en">
        <Head>
          <meta charSet="utf-8" />
          <meta content="IE=edge" httpEquiv="X-UA-Compatible" />
          <meta content="width=device-width,initial-scale=1" name="viewport" />
          <title>Schoenwald.media</title>
          <meta name="description" content="Thoughts on CSS, JS, and overall clean code." />
        </Head>
        <body>
          <Main />
          <NextScript />
        </body>
      </html>
    );
  }
}

I'd expect that the favicons-webpack-plugin generates the icons, and the html-webpack-plugin inject it in the <head/> of the page. Which it doesn't.

Steps to Reproduce

  1. Checkout https://github.com/schoenwaldnils/blog
  2. Set up .envfile with
HOST=localhost
PORT=3000
  1. docker-compose up

Environment

Tech Version
next ~4.0.0-beta.4
html-webpack-plugin ~2.30.1
favicons-webpack-plugin 0.0.7
node 8.4.0
OS mhart/alpine-node:8.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions