Skip to content

@requires autofill: multiple of the same dependency #294

@DenisMir

Description

@DenisMir

I have found the error that requires dependencies are getting referenced multiple times in the rendered output when some mixin is using some function multiple times.

/**
 * Some function that gets used from other mixins
 */
@function base() {}

/**
 * Some mixin that uses the `base` function multiple times
 */
@mixin fails() {
  base();
  base();
}

/**
* Some mixin that uses the `base` function multiple times
* @requires base
*/
@mixin works() {
  base();
  base();
}

Manually adding the @requires fixes the bug in this simple case. In more complex mixins this is not enough and I'm getting multiple dependencies all over.

An example can be found right here:

https://github.com/DenisMir/sassdoc-bugs/blob/master/src/requires-autofill-bug.scss

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions