Search code examples
javascriptcsswebpackes6-module-loader

Module parse failed or Loader not found


So I've been trying to add a CSS loader into webpack.config.js, my code looks like this:

module.exports = {
    entry: './scripts/entry.js',
    output: {
        filename: 'bundle.js'
    },
    devtool: 'source-map',
    module: {
        loaders: [
            { 
                test   : /\.css$/,
                include: /scripts/,
                loader : "style!css"
            }
        ]
    }
};

enter image description here

and here is a picture with all files and path to them, when I call

require('style!css!./style.css');

it executes nicely, but if I call

require('./style.css');

the error shows up. Am I defining a wrong path somewhere or did I write the loader wrong?


Solution

  • So the problem was in using gulp.watch() and compiling withwebpack