-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support absolute import paths in less files #107
Conversation
lib/index.js
Outdated
const pathname = path.posix.join(currentFileInfo.currentDirectory, file); | ||
let pathname = path.posix.join(currentFileInfo.currentDirectory, file); | ||
if (path.isAbsolute(file)) { | ||
pathname = path.posix.join(file); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this single join good for? isn't this just a normalize?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and the join call in L153 is unnecessary for an absolute file, maybe better move it into an else branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be path.posix.isAbsolute?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be path.posix.isAbsolute?
done with 39df2b1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. But I don't know the code enough for an approval.
Absolute import paths are supported with this change
e.g. file
test/fixtures/libraries/scopes/comments/lib3/comments/themes/bar/library.source.less
will be passed as "/lib3/comments/themes/other/sub/my.less" to the filesystem.
Before it was interpreted as a relative path (without the leading slash ("/").
This is especially useful when the filesystem layer is abstracted such as @ui5/fs.