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
sass-loader 12 no longer compatible with node-sass-import-once #972
Comments
Please open an issue in |
Also we don't change API for v12, only drop old Node.js version and fix small bug with |
Last activity 5 years ago, so I doubt that'll do any good.
But usually it works fine.... With many different CSS files and modules in a larger application it is not feasible to rewrite the scss to remove the duplicates without a massive amount of work. |
If you really need help please - create reproducible example (you can just create minimal example), without code I can't say what is wrong and this problems will be never resolved.
|
Sure, I hoped you might have a idea what could have caused this :) I'll try to debug it a bit myself and then create a minimal testcase to reproduce it. |
@ThiefMaster feel free to ping me, note - by default we use |
@alexander-akait here's a minimal testcase to reproduce it: https://github.com/ThiefMaster/sass-loader-test |
I managed to work around the issue using this wrapper: function _importOnce(...args) {
// Due to https://github.com/webpack-contrib/sass-loader/pull/958/files we need to
// use a different context for the importOnce plugin in order to keep the cache
// between calls to this function.
// Using a global one might work as well but like this it's scoped with the same
// lifetime which we had before the sass-loader update as `options` is cloned at
// the same time the object previously used in `this` was created (`context` in
// `getOptions`).
this.options._ctx = this.options._ctx || {options: this.options};
return importOnce.apply(this.options._ctx, args);
} |
@ThiefMaster I see... but really on |
Expected Behavior
https://github.com/at-import/node-sass-import-once working fine to de-duplicate imported css rules
Actual Behavior
It doesn't work, I get many duplicate rules in my final css file, since my (rather large) scss has some imports repeated in multiple files (usually to get some mixins etc, but we have both css rules and mixin in some of those files)
I do not have a minimal example yet, so I'm hoping it's something obvious, e.g. some API change that broke this (very old) library.
The text was updated successfully, but these errors were encountered: