-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Description
I think this version does not work with webpack 5. I have the following:
{
test: /\.(gif|jpe?g|png|svg|tiff)(\?.*)?$/,
include: [path.resolve(__dirname, 'src/photography')],
loader: "sharp-loader",
options: {
name: "[name].[hash:8].[ext]",
cacheDirectory: true,
presets: {
// Preset 1
thumbnail: {
format: ["webp", "jpeg"],
width: 200,
quality: 60,
},
// Preset 2
prefetch: {
// Format-specific options can be specified like this:
format: { id: "jpeg", quality: 30 },
mode: "cover",
blur: 100,
inline: true,
size: 50,
},
},
},
},
// Images: Copy image files to build folder
{ test: /\.(?:ico|gif|png|jpg|jpeg)$/i, type: 'asset/resource' }
import testImage from '../../photography/fullsizeoutput_203a.jpeg?{"outputs":["thumbnail"]}';
It appears the query parameters are ignored and the result of testImage is undefined. Is this something to do with the new asset modules?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels