сам конфиг и зависимости ошибка просто 404, подключаю картинки в jsx через src раньше все работало src="../../../../../img/logo_white.webp"
"@babel/cli": "^7.7.5",
"@babel/core": "^7.7.5",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/preset-env": "^7.7.6",
"@babel/preset-react": "^7.7.4",
"babel-loader": "^8.0.6",
"css-loader": "^3.3.2",
"html-webpack-plugin": "^5.5.1",
"mini-css-extract-plugin": "^2.7.5",
"sass": "^1.23.7",
"sass-loader": "^8.0.0",
"style-loader": "^1.0.1",
"webpack": "^5.79.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.13.3",
"yargs": "^13.3.2"
const HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const webpack = require("webpack");
module.exports = (env, argv) => {
const isProd = argv.mode === "production";
const config = {
entry: "./src/index.jsx",
output: {
publicPath: "auto",
},
module: {
rules: [
{
test: /.jsx?$/,
use: ["babel-loader"],
},
{
test: /.s?css$/,
use: [
isProd ? MiniCssExtractPlugin.loader : "style-loader",
"css-loader",
"sass-loader",
],
},
{
test: /\.(png|svg|jpg|jpeg|gif|webp)$/i,
type: "asset/resource",
},
],
},
resolve: {
extensions: [".js", ".jsx"],
},
plugins: [
new webpack.ProgressPlugin(),
new HtmlWebpackPlugin({
template: "./src/index.html",
}),
],
devServer: {
hot: true,
},
devtool: "source-map",
};
if (isProd) {
config.plugins.push(
new MiniCssExtractPlugin({
filename: "[name].css",
})
);
}
return config;
};