sass / migrator

Tool for migrating stylesheets to new Sass versions
MIT License
89 stars 11 forks source link

Remove redundant @use rules #135

Open nex3 opened 4 years ago

nex3 commented 4 years ago

Currently, if a file contains an @import rule that loads a file F as well as an implicit reference to a member loaded from a file G that forwards F, the migrator will generate @use rules for both F and G when only generating one for G would suffice.

nex3 commented 4 years ago

I think this may require restructuring how @use rules are generated. Rather than lazily adding rules when a member use is encountered from a file that hasn't been @used yet, References could track all upstream files for a given source file and the migrator could eagerly generate @uses based on that information.