E
E
Enfiladed2019-11-13 23:48:59
webpack
Enfiladed, 2019-11-13 23:48:59

Why is ExtractTextPlugin not working?

Hello! I am learning to use webpack, the ExtractTextPlugin plugin does not work, in the end I even copied the entire tutorial code, it did not help.

const ExtractTextPlugin = require('extract-text-webpack-plugin');
module: {
     rules: [
       {
          test: /\.css$/,
          use: ExtractTextPlugin.extract(
            {
               fallback: 'style-loader',
               use: ['css-loader']
            })
        }
     ]
  },
  plugins: [
    new ExtractTextPlugin({filename: 'style.css'})
  ]

This is just the basics, and that's all css related. When running webpack in dev mode, it throws an error:
ERROR in ./src/style.css 1:5
Module parse failed: Unexpected token (1:5)
You may need an appropriate loader to handle this file type, currently no loader
s are configured to process this file. See https://webpack.js.org/concepts#loade
rs
> body {
|    background-color: red;
| }
 @ ./src/index.js 1:0-20

Reinstalled css-loader and style-loader a couple of times. What else could be wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question