-
-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
data
option no longer supported in sassOptions
#760
Comments
Ack, of course I decided to look at the CHANGELOG after posting this issue. 🙈 So I see that:
However, the README does not indicate this clearly as it just points people to the node-sass and dart-sass libs, with the former still claiming support for the |
I want to point that
|
@yairEO Did you try this: {
test: /\.(sass|scss)$/,
use: [
'style-loader',
'css-loader',
{
loader: 'sass-loader',
options: {
sassOptions: {
includePaths: [path.resolve(__dirname, 'node_modules')],
},
},
},
],
include: path.resolve(__dirname, '../'),
} |
The You can send a PR to CHANGELOG if something misleading for you |
NOTE: This is a completely bare-bones project I just started, so there should be no complex configurations conflicting behind the scenes.
Expected Behavior
When setting:
I would expect the "blah" module (which only contains variable definitions) to be compiled in front of any
.scss
which I have imported into a component.Actual Behavior
In my webpack config, the
data
property seems to not be honored. I know this because I get an error (SassError: Undefined variable: "$Nav-width".
) when I start the server and the initial compilation takes place. I jumped intonode_modules/sass-loader/dist/getSassOptions.js
and added some log statements to see what was happening. The first log was forloaderOptions
while the second is foroptions
, as shown here when i started the webpack-dev-server (note that there are 4 components importing their own sass styles):You can see that my options are being honored in
loaderOptions
but the newoptions
object to be returned replaces that property with the contents of each component's.scss
file. I should also say here that I am using the exact same setup in another project, but with older syntax (i.e. nosassOptions
object) to support less-recent versions:Code
Note that I'm trying to import the existing file:
${__dirname}/src/sass-noop/_noop.scss
How Do We Reproduce?
Just try using the
data
property to import some variables ahead of each sass file imported within components.I even tried putting in invalid paths in the webpack config as well as syntax errors in the sass files to be imported, but nothing throws. This indicates to me that the data option is simply never being processed.
The text was updated successfully, but these errors were encountered: