I'm trying to upgrade to yarn 2, and am running into a bit of a road block when it comes to "using" array based loaders and resolving properly.
Here is an excerpt from the previous working webpack configuration.
...
{
test: /\.(gif|png|jpeg|jpg|svg)$/i,
include: path.resolve(__dirname, "./static/images"),
use: [
"file-loader",
{
loader: "image-webpack-loader",
options: {
mozjpeg: { progressive: true },
gifsicle: { interlaced: true },
optipng: { enabled: false },
pngquant: { enabled: false }
}
}
]
},
...
Running yarn dlx @yarnpkg/doctor
returns the following error message.
assets/webpack.common.js:33:14: Webpack configs from non-private packages should avoid referencing loaders without require.resolve
Line 33 column 14 is the opening bracket character for the 'use' key.
When I wrap the loader strings in a require.resolve(...)
I get the same error from the yarn doctor command.
Does anyone have an idea why there is an issue resolving here? This should be completely fine based on the docs from webpack but I'm not certain which tool is having difficulty here.
https://webpack.js.org/configuration/module/#ruleuse
Environment: OSX: 10.15.7 (19H15) - Catalina
node -v: v15.3.0
yarn --version: 2.4.0
webpack: ~5.9.0