Enable this plugin only during development mode
See original GitHub issuehey
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;
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Enable Developer Mode, Install Plugin Loader & PowerTools ...
Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top...
Read more >Development mode - PF4J
In DEVELOPMENT mode you can developing plugins in a simple and fast mode. Lets describe how DEVELOPMENT runtime mode works. First, you can...
Read more >Enable Dev Mode not working - WordPress.org
I can't enable dev mode either because a live account was partially connected. I emailed support and they only suggested to delete the...
Read more >Disable UglifyJSPlugin when doing development work?
You could also make your config script generate a config object that only includes that plugin if you're running in production (eg.
Read more >Mode | webpack
Sets process.env.NODE_ENV on DefinePlugin to value development . Enables useful names for modules and chunks. production ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
one more idea:
can we move all of this into the plugin?
We could in the
afterPlugins
webpack hook iterate over all loaders - search for babel and check if it containsreact-refresh/babel
- if not push it.So the webpack prod(disabled)/dev(enabled) config change to add the refresh plugin would look like this:
That way it would even be cli compatible e.g.:
or
I came here from react-hot-loader, and installation steps discourages me since it forces my configuration to check whether is production or development build.
In react-hot-loader it’s written:
Please consider the same.