I am trying to learn reactjs according to a tutorial. Meanwhile the tutorial instructs to use webpack for compiling stylesheets and JS assets. I am stuck in an error where the stylesheets cannot get compiled and throws following error while compiling the file using webpack. It displays following error :
ERROR in ./src/stylesheets/hello.css (./node_modules/css-loader!./node_modules/postcss-loader/lib!./src/stylesheets/hello.css)
Module build failed: Error: No PostCSS Config found in: E:developerstartsrcstylesheets
at E:developerstart
ode_modulespostcss-load-configindex.js:51:26
at <anonymous>
@ ./src/stylesheets/hello.css 2:14-124
@ ./src/lib.js
@ ./src/index.js
@ multi (webpack)-dev-server/client?http://localhost:4000 ./src/index.js
I have done everything according to the tutorial but somehow this error persists and couldn't solve this as I am very new to this. My webpack configuration file webpack.config.js is as follows:
module: {
rules: [
{
test: /.css$/,
use: [{
loader: "style-loader" // creates style nodes from JS strings
}, {
loader: "css-loader" // translates CSS into CommonJS
}, {
loader: "postcss-loader" // compiles Sass to CSS
}]
},
{
test: /.scss$/,
use: [{
loader: "style-loader" // creates style nodes from JS strings
}, {
loader: "css-loader" // translates CSS into CommonJS
}, {
loader: "postcss-loader" // compiles Sass to CSS
}, {
loader: "sass-loader" // compiles Sass to CSS
}]
}
]
}
};
question from:
https://stackoverflow.com/questions/49709252/no-postcss-config-found 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…