0

On an Angular 9 home.component.less file I tried to import a global less file:

@import (reference) './mixins.less';

The file is on the project root along with index.html. So the structure is:

src
  mixins.less
  index.html
  app
    home
      home.component.less

When I build it I get the error:

Can't resolve './mixins.less' in '/project/src/app/home'

How can I solve this?

Miguel Moura
  • 36,732
  • 85
  • 259
  • 481

1 Answers1

1

This is most likely a path error.

Try

@import (reference) '../../mixins.less';

To search for the file in the src folder.

kacase
  • 1,993
  • 1
  • 18
  • 27