
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
image-config-webpack-plugin
Advanced tools
Creating a webpack loader configurations can be quite time consuming.
The image-config-webpack-plugin is part of the common-config-webpack-plugin suite which tries to provide best practices for the most common loader requirements.
If no mode is explicitly set for the plugin the configuration will adjust depending on your webpack mode setting.
⚙️development mode webpack.config.js
⚙️production mode webpack.config.js
npm i --save-dev image-config-webpack-plugin
In most projects you will need to set up project specific options but you can still use all or some common-config-webpack-plugin parts.
const ImageConfigWebpackPlugin = require('image-config-webpack-plugin');
module.exports = {
plugins: [new ImageConfigWebpackPlugin()],
};
By default the image-config-webpack-plugin adds a md5 hash of the image files content to the file name
to allow long-term-caching.
For example: static/media/burger.c8ffdeb3.png
To change the file name path an option called name can be passed to the image-config-webpack-plugin.
The name option supports different placeholders.
const ImageConfigWebpackPlugin = require('image-config-webpack-plugin');
module.exports = {
plugins: [
new ImageConfigWebpackPlugin({
name: 'media/[ext]/[name].[hash:7].[ext]',
}),
],
};
2.0.3 (2021-05-20)
Note: Version bump only for package webpack-config-plugins
FAQs
Preset for image webpack configuration
We found that image-config-webpack-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.