После нескольких часов проб и ошибок я нашел решение.Для тех, кто столкнется с этой проблемой в будущем, я исправил ее, добавив следующий тест в мой файл webpack.config.js -
{
test: /\.(scss|css)$/,
include: [CODEMIRROR_PATH],
use: [
{
loader: "style-loader"
},
{
loader: "css-loader",
},
]
},
Моя настройка конфигурации заполнения следующая -
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
.BundleAnalyzerPlugin;
const HtmlWebPackPlugin = require("html-webpack-plugin");
const autoprefixer = require("autoprefixer");
const path = require("path");
const CODEMIRROR_PATH = path.resolve(
__dirname,
"./node_modules/rc-slider/assets/index.css"
);
module.exports = {
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
},
{
test: /\.html$/,
use: [
{
loader: "html-loader"
}
]
},
{
test: /\.(scss|css)$/,
include: [CODEMIRROR_PATH],
use: [
{
loader: "style-loader"
},
{
loader: "css-loader",
},
]
},
{
test: /\.(scss|css)$/,
exclude: /node_modules/,
use: [
{
loader: "style-loader"
},
{
loader: "css-loader",
options: {
importLoaders: 2,
modules: true,
localIdentName: "[name]__[local]__[hash:base64:5]"
}
},
{
loader: "sass-loader"
},
{
loader: "postcss-loader",
options: {
ident: "postcss",
plugins() {
return [autoprefixer];
}
}
}
]
},
{
test: /\.(png|jp(e*)g|gif|svg)$/,
use: [
{
loader: "url-loader",
options: {
limit: 8000,
name: "images/[hash]-[name].[ext]"
}
}
]
}
]
},
plugins: [
new HtmlWebPackPlugin({
template: "./src/index.html"
}),
new BundleAnalyzerPlugin()
]
};