I'm using webpack. I have lots of sass files. Each file imports "common.sass" file. I do not want to write @import "common.sass" in each file. How can I avoid of writing it in each file? Maybe there is opportunity to add somehow string @import "common.sass" in each file?
You can't avoid the import, because each sass partial is being processed in isolation by your loaders. But, you can avoid having to add that line to each file. Baggage-loader is a loader that lets you specify other modules that should automatically be included when loading a module. It's pretty simple and flexible, and easy enough to fork and modify if you need to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With