-
-
Notifications
You must be signed in to change notification settings - Fork 164
require.resolve('source-map-support') if using lerna #44
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
Conversation
nice. |
banner: `require('${require.resolve('source-map-support/register')}')` | ||
banner: `require('${ | ||
// Is source-map-support installed as project dependency, or linked? | ||
require.resolve('source-map-support').match(process.cwd()) |
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.
.indexOf(process.cwd()) === 0
would be more reliable than .match(process.cwd())
if .match
here is String.prototype.match
, not anything special.
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.
@sompylasar Can you clarify again? I considered indexOf
, but found String.prototype.match
to read better.
Thanks!
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.
match
finds in any place of the string, but indexOf() === 0
ensures it's at the start.
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.
Oh, of course! I figured since it's /Users/Me/whatever
the risk was low.
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.
@ericclemmons should we fix this on master with a new PR?
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 risk was low.
Yes. Low but not zero. The underlying intended logic is indexOf() === 0
here.
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.
@sompylasar feel free to submit a PR and I will release and bump version
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.
This banner
is writing absolute paths on bundles, and it's hard to notice unless you are using some tests on CI like environment @jaredpalmer
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.
created a issue here #124
Fixes #42.
I couldn't do
hub pull-request -i 42
: