-
Notifications
You must be signed in to change notification settings - Fork 93
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
Set from option for stdin to process.cwd() + 'stdin.css' #115
Conversation
index.js
Outdated
@@ -279,7 +279,7 @@ function css (css, file) { | |||
if (file === 'stdin' && output) file = output | |||
|
|||
// TODO: Unit test this | |||
if (file !== 'stdin') options.from = file | |||
options.from = file === 'stdin' ? path.join(process.cwd(), 'stdin.css') : 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.
The dummy file stdin.css
is a requirement or would process.cwd()
just be fine also ? Sourcemaps won't work either way
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.
cc @ai 😛
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.
The issue at hand is that some plugins do path.dirname(options.from)
to get the containing folder as the basis for resolving other files relative to the CSS. So yes, we need a dummy filename. Perhaps it should be stdin
instead of stdin.css
to avoid confusion (especially with SugarSS)?
LGTM |
@ai @michael-ciniawsky Thoughts on using |
Yeap, it will be better |
Should fix #114; will revert if this causes other issues.
Updated |
Should fix #114; will revert if this causes other issues.
@michael-ciniawsky @ai Please review