avoid @import being included twice - rails engine

93 Views Asked by At

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.

1

There are 1 best solutions below

0
On

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