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
includePaths is an option of node-sass and sass-loader just passes it through when compiling.
The problem is, this plugin doesn't look for this path when resolving the current imported file to decide whether or not to include the antd theme variables in src/antdSassLoader.js at line 22. It simply uses the resolver of sass-loader, not node-sass. This means that importing my antd theme file using an absolute path (e.g. @import 'style/theme.scss';) does not expose the antd theme variables.
The workaround is simply to use a relative path when importing this specific file when the antd variables are needed, but this is tedious.
Do you think adding an option to allow custom root folder, or an option to specify a resolver function overriding sass-loader's importsToResolve() would be viable for this plugin?
My best guess would be to simply consider this behaviour non standard and never use absolute paths on @import.
The text was updated successfully, but these errors were encountered:
Hello,
I have been using your plugin with
sass-loader
andnode-sass
.node-sass
has an option which allows us to specify the root folder of absolute@import
paths:includePaths
is an option ofnode-sass
andsass-loader
just passes it through when compiling.The problem is, this plugin doesn't look for this path when resolving the current imported file to decide whether or not to include the antd theme variables in
src/antdSassLoader.js
at line 22. It simply uses the resolver ofsass-loader
, notnode-sass
. This means that importing my antd theme file using an absolute path (e.g.@import 'style/theme.scss';
) does not expose the antd theme variables.The workaround is simply to use a relative path when importing this specific file when the antd variables are needed, but this is tedious.
Do you think adding an option to allow custom root folder, or an option to specify a resolver function overriding
sass-loader
'simportsToResolve()
would be viable for this plugin?My best guess would be to simply consider this behaviour non standard and never use absolute paths on
@import
.The text was updated successfully, but these errors were encountered: