I'm trying to use less loader in webpack and the issues is - I've installed less loader locally, but when I try to compile everything using webpack command in bask, it prints out: "ERROR in Cannot find module 'less'". In my entry point I require some less file like
require("./less_components/style.less");
Here is my webpack.config file
module.exports = {
entry: "./entry.js",
output: {
path: "./build",
filename: "./bundle.js"
},
module: {
loaders: [
{test: /\.js$/, exlude: /node_modules/, loader: "babel-loader"},
{test: /\.less$/, loader: "style!css!less"}
]
}
}
What's the matter and how I should fix it?
This error happens because npm@3 does not resolve peerDependencies any more.
npm install less less-loader
is the way to go.