Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding common.sass file to each file

Tags:

sass

webpack

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?

like image 747
pavel06081991 Avatar asked Nov 19 '25 00:11

pavel06081991


1 Answers

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.

like image 54
Brendan Gannon Avatar answered Nov 22 '25 04:11

Brendan Gannon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!