Получение этой ошибки при переходе с response-app-rewired на Webpack
Ошибка
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Cannot use styleName attribute for style name 'gx-d-none' without importing at least one stylesheet.
at styleNameValue.split.filter.map.styleName
webpack-config.js
const path = require("path");
const HWP = require("html-webpack-plugin");
module.exports = {
entry: path.join(__dirname, "/src/index.js"),
output: {
filename: "build.js",
path: path.join(__dirname, "/dist")
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: "babel-loader",
options: { babelrc: true }
},
{
test: /\.(css|scss|sass)$/,
use: [
"style-loader?sourceMap",
"css-loader?modules='true'&importLoaders='1'&localIdentName=[path]___[name]__[local]___[hash:base64:5]",
"sass-loader?sourceMap"
]
},
{
test: /\.(eot|woff|woff2|ttf|svg|png|jpe?g|gif|ico)(\?\S*)?$/,
loader: "url-loader?name=[name].[ext]"
}
]
},
plugins: [
new HWP({
template: path.join(__dirname, "/public/index.html")
})
]
};
.babelrc
{
"presets": ["@babel/preset-react"],
"plugins": [
"babel-plugin-transform-object-rest-spread",
"@babel/plugin-proposal-class-properties",
"css-modules-transform",
"babel-plugin-react-css-modules"
]
}