I implement a React.Component
in a.js
. This file will be used for client and server side rendering. Of course a.js
has require("a.scss")
Is there a way to do on webpack.config.js
only to tell webpack not to read all the scss` require statement during the bundling?
I did try the IgnorePlugin
to *.scss
. The bundling process is fine but node
gives runtime error which is Cannot find module './a.scss'
Here are the unwanted suggestions
DefinePlugin
or EnvironmentPlugin
because I don't want to wrap the require("a.scss")
inside an if
statementExtractTextWebpackPlugin
to extract the scss
which is I am currently using. Let node
can run the bundled js
perfectly.This is the solution
{
"test": /\.s?css$/,
"use": "null-loader"
}