4👍
Webpack doesn’t understand CSS
files out of box. You need to use css-loader
with style-loader
to handle CSS files.
module.exports = {
entry: "./src/index.js",
output: {
path: path.resolve(__dirname, "./static/frontend"),
filename: "[name].js",
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
},
},
// Additional configuration to handle *.css files
{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
},
],
},
// Other remaining configuration
};
Source:stackexchange.com