Answer the question
In order to leave comments, you need to log in
How to import css into webpack?
I decided to learn Webpack, but I stumbled almost at the very beginning - I could not import CSS.
Installed the style-loader and css-loader packages.
In index.js entered
In webpack.condig.js:import './sass/main.css';
module.exports = {
module: {
rules: [
{
test: /\.сss$/,
use: ['style-loader', 'css-loader']
}
]
}
};
ERROR in ./src/sass/main.css 1:5
Module parse failed: Unexpected token (1:5)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> body {
| background: pink; }
|
@ ./src/index.js 2:0-25
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question