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"
}
]
}
};
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?
So the problem was in using gulp.watch()
and compiling withwebpack