-
-
Notifications
You must be signed in to change notification settings - Fork 608
Keep :export also for non-CSS-modules #1161
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
Comments
Please set https://github.com/webpack-contrib/css-loader/blob/master/src/options.json#L39 |
// --------
// SCSS GENERAL
{
test: /\.(scss)$/,
exclude: /\.module\.(scss)$/,
use: [
// ...
{
loader: 'css-loader',
options: {
importLoaders: 3,
sourceMap: true,
modules: {
compileType: 'icss'
}
}
},
// ...
]
},
// --------
// SCSS MODULES
{
test: /\.module\.(scss)$/,
// ...
}, This setup works Tried modules: {
compileType: 'icss'
auto: false
} Apparently auto needs not to be defined. Together with the fact that previously modules could be left out altogether (see OP Expected Behavior / Situation) the behaviour has changed quite a lot. What about having loader behave as modules: {
compileType: 'icss'
} if modules key is left out, instead of behaving as modules: undefined as that would kind of resemble as what css-loader in practice did before v4? |
There are two cases:
So both configuration is valid, but maybe we should docs this |
Using |
see the pull request
containing project variables in some |
@evilebottnawi PR for doc addition passing now, please review. thanks! |
Fixed #1163, logic for |
Uh oh!
There was an error while loading. Please reload this page.
Expected Behavior / Situation
Previously my setup was as follows
and having
:export
directive in non-module scss file workedvariables.scss
somejavascript.js
Actual Behavior / Situation
Now, using the new configuration syntax
bringing SCSS variables into JavaScript does not work for SCSS files which are not considered modules.
Note, that moving
:export
to module file does bring back variables into JS ->variables.module.scss
somejavascript.js
does work.
Modification Proposal
Is the assumption that the new implementation allows SCSS
:export
only to be used when modules are true?If so can it be reverted to the previous behaviour?
Thanks!
The text was updated successfully, but these errors were encountered: