Doesn't seem to work with responsive loader
See original GitHub issueThis is my config file
const ImageminPlugin = require('imagemin-webpack').ImageminWebpackPlugin;
const responsiveSharp = require('responsive-loader/sharp');
const ImageminWebp = require('imagemin-webp');
const config = {
entry: './src/index.js',
output: {
filename: '[name].js',
pathinfo: false
},
module: {
rules: [
{
test: /\.(css)$/,
use: [
{
loader: 'style-loader',
},
{
loader: "css-loader", // creates style nodes from JS strings
}
]
},
{
test: /\.(png|jpe?g|svg|bmp|gif|webp)$/,
use: [
{
loader: 'url-loader',
options: {
limit: 10000,
name: 'images/[name].[hash].[ext]',
fallback: 'responsive-loader',
adapter: responsiveSharp
}
}
]
}
]
},
plugins: [
],
}
const imagemin2 = new ImageminPlugin({
// name: 'imagemin/[name].[hash].webp',
imageminOptions: {
plugins: [
ImageminWebp({
loseless: true
})
]
}
});
// config.plugins.push(imagemin);
config.plugins.push(imagemin2);
module.exports = config;
Add/removing this plugin with responsive-loader
doesn’t seem to effect image size in any way however if I disable responsive-loader
and enable this it does produce minified image.
I am expecting it to minify images that go through responsive loader.
This is my package.json
"devDependencies": {
"css-loader": "^1.0.0",
"file-loader": "^2.0.0",
"imagemin-gifsicle": "^5.2.0",
"imagemin-jpegtran": "^5.0.2",
"imagemin-mozjpeg": "^7.0.0",
"imagemin-optipng": "^5.2.1",
"imagemin-svgo": "^7.0.0",
"imagemin-webp": "^4.1.0",
"imagemin-webpack": "^3.0.0",
"responsive-loader": "^1.1.0",
"sharp": "^0.21.0",
"style-loader": "^0.23.1",
"url-loader": "^1.1.2",
"webpack": "^4.26.1",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.10"
},
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Loading animation is not responsive - javascript - Stack Overflow
1 Answer 1 ... You didn't include your styles for your preload overlay, but, if it is an option, flexbox is your best...
Read more >A webpack loader for responsive images - GitHub
A webpack loader for responsive images. Creates multiple images from one source image, and returns a srcset . For more information on how...
Read more >Hestia does not offer responsive images, even with Optimole
Optimole, the solution advertised for response images, does not seem to work with the slide images used in the Big Title section. These...
Read more >Lazy-load doesn't support Responsive image formatter - Drupal
Hi, I am using the D8 version of Lazy. It does not give any performance boost. I can see that the tag 'b-lazy'...
Read more >Preloading responsive images - web.dev
Learn about new and exciting possibilities for preloading responsive images to ensure great user experience.
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
@evilebottnawi Sure. I will do that when I found time today or tomorrow
Done in master, release will be in near future