Skip to content
This repository has been archived by the owner on Mar 15, 2021. It is now read-only.

Relative import needs file extension #8

Open
rspilker opened this issue Nov 14, 2018 · 2 comments
Open

Relative import needs file extension #8

rspilker opened this issue Nov 14, 2018 · 2 comments
Assignees
Labels
Milestone

Comments

@rspilker
Copy link

@import "../../foo" gives an error where @import "../../foo.less" works:

Cannot read content of the "<path>\..\..\foo" file: File '<path>\..\..\foo' does not exist

Some other Less Compiler Plugin handles this as I expected.

@agabrys agabrys self-assigned this Nov 14, 2018
@agabrys agabrys added the bug label Nov 14, 2018
@agabrys
Copy link
Contributor

agabrys commented Nov 14, 2018

The documentation confirms that the compiler should behave in the way as you expected (see below).

I'm working on a second version of the LessCSS Compiler and this plugin. I'll verify if the problem exists on a new version. Please be aware that Extended LessCSS Compiler will be deprecated in the near future - which means LessCSS Maven Plugin 1.X also will be deprecated and replaced by version 2.X.


File Extensions
@import statements may be treated differently by Less depending on the file extension:

  • If the file has a .css extension it will be treated as CSS and the @import statement left as-is (see the inline option below).
  • If it has any other extension it will be treated as Less and imported.
  • If it does not have an extension, .less will be appended and it will be included as a imported Less file.

Examples:

@import "foo";      // foo.less is imported
@import "foo.less"; // foo.less is imported
@import "foo.php";  // foo.php imported as a Less file
@import "foo.css";  // statement left in place, as-is

@agabrys
Copy link
Contributor

agabrys commented Dec 6, 2018

Hi, I apologize for the delay, but I had a lot of work.

I have good and bad news:

@agabrys agabrys added this to the 2.0.0 milestone Dec 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants