sass-loader additionalData not working for sass variable [SassError: Undefined variable.] #17612
Unanswered
matthieunelmes
asked this question in
Q&A
Replies: 1 comment
-
@matthieunelmes Having the same issue now. Assuming you found a fix for it? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to use process env variables within sass in a React application to set colours.
Freshly create-react-app.
"webpack": "^5.64.4"
"sass": "^1.66.1",
"sass-loader": "^12.3.0",
Ejected from CRA and created a webpack.config.js at the root.
Following documentation from:
https://webpack.js.org/loaders/sass-loader/#string-1
.env contains:
ENV_COLOR='#114598'
App.scss:
Repo to replicate issue can be found here:
https://github.com/matthieunelmes/webpack-test
Beta Was this translation helpful? Give feedback.
All reactions