Skip to content

Enable this plugin only during development mode #173

@jantimon

Description

@jantimon

hey

the https://github.com/jantimon/favicons-webpack-plugin is only generating the full favicon during production mode by default.
so if you set mode: "development" it will not be active unless you overrule that setting.

what about adding something similar to ReactRefreshWebpackPlugin?

the api could look like this:

// Only active during development
new ReactRefreshWebpackPlugin()
// Active for dev and prod
ReactRefreshWebpackPlugin({
  alwaysEnabled: true
})

to find out wether you are in production mode or in dev mode you can use the following snippet inside any hook:

// From https://github.com/webpack/webpack/blob/3366421f1784c449f415cda5930a8e445086f688/lib/WebpackOptionsDefaulter.js#L12-L14
    const isProductionLikeMode =
      compiler.options.mode === 'production' || !compiler.options.mode;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions