You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I posted this question on stackoverflow but I think it was not the good place.
I am trying to import variables from .json file in a .scss file with node-sass-json-importer package.
I am facing a problem because this package is not automatically integrated in react-scripts/config/webpack.config.js. So, I would like to modify this file as follows below :
Add an optional preProcessorOptions object parameter to getStyleLoaders function. Indeed, this function has no preprocessor options const getStyleLoaders = (cssOptions, preProcessor) and the only option added by default is sourceMap: true. Of course, this function will take in account this new parameter.
Add a third parameter in the getStyleLoaders call for scss file.
It works on a minimal webpack implementation (without react). But, I suppose it is not so easy to apply changes to react-scripts/config/webpack.config.js and I suspect I will have many problems. Perhaps, there is an another way to do it.
Thanks for answer.
(Please be free to answer me that this place is not the right place to ask this kind of question)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I posted this question on stackoverflow but I think it was not the good place.
I am trying to import variables from .json file in a .scss file with
node-sass-json-importer
package.I am facing a problem because this package is not automatically integrated in
react-scripts/config/webpack.config.js
. So, I would like to modify this file as follows below :const jsonImporter = require ('node-sass-json-importer');
preProcessorOptions
object parameter to getStyleLoaders function. Indeed, this function has no preprocessor optionsconst getStyleLoaders = (cssOptions, preProcessor)
and the only option added by default issourceMap: true
. Of course, this function will take in account this new parameter.It works on a minimal webpack implementation (without react). But, I suppose it is not so easy to apply changes to react-scripts/config/webpack.config.js and I suspect I will have many problems. Perhaps, there is an another way to do it.
Thanks for answer.
(Please be free to answer me that this place is not the right place to ask this kind of question)
Beta Was this translation helpful? Give feedback.
All reactions