2

i have a rails engine which is being consumed by an application. The engine and the application both are dependent on a mixin file so both of them does

@import 'mixins'

But on css compression these mixins will be included twice.

Is there anyway to avoid this duplication.

Vinay
  • 41
  • 5
  • If you are using Less v.15 and above `import`'s default behavior is that file is imported only once and subsequent import statements for that file will be ignored. http://lesscss.org/features/#import-options-once – Colin Bacon Jul 15 '14 at 16:33
  • Thanks for the link. I played around a bit and saw it was ignoring it. – Vinay Jul 16 '14 at 17:15

1 Answers1

0

Having multiple @import's of the same Less file is no longer a problem. As of Less v1.5, the default behavior of @import is to only import that file once. So you will not get duplicate styles in your compiled stylesheet.

For more info see the Less docs: Import once

Colin Bacon
  • 15,436
  • 7
  • 52
  • 72