node-sass-magic-importer
node-sass-magic-importer copied to clipboard
Multiple Webpack entries importing mixins fails to compile
We have a number of entry files A.scss and B.scss both A + B make use of a mixin called 'sass-mq' for handling breakpoints. When compiling through webpack and including this plugin the 2nd entry (B) fails due to not having the 'sass-mq' import loaded.
I presume the script is blocking the 2nd import because it was imported in the other entry file (A).
It would be great if we could choose whether to prevent multiple imports across entries or not
Hey @christopherdarling,
you can already do this with the disableImportOnce
option: https://github.com/maoberlehner/node-sass-magic-importer/tree/master/packages/node-sass-magic-importer#options :)
hey @maoberlehner, sorry I over-simplified my example. We still want to run import-once on each entry so for example;
A.scss (@import sass-mq)
./modules/header.scss (@import sass-mq and others)
./modules/footer.scss (@import sass-mq and different others)
(3x @imports of sass-mq)
B.scss
./modules/other.scss (@import sass-mq and others)
(1x @import of sass-mq)
In this example, we would want @import to be imported once per-entry, so that the @import of sass-mq only gets executed once for each entry (A.scss + B.scss)
Ah, ok I think I understand. That's tricky, I guess. But I'll think about it!