Skip to content

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

Merged
merged 1 commit into from
Feb 15, 2017

Conversation

ericclemmons
Copy link
Contributor

Fixes #42.

I couldn't do hub pull-request -i 42:

Error creating pull request: Unprocessable Entity (HTTP 422)
Not allowed to change field "issue"

@jaredpalmer
Copy link
Owner

nice.

@jaredpalmer jaredpalmer merged commit 4b5209e into jaredpalmer:master Feb 15, 2017
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())
Copy link
Contributor

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.

Copy link
Contributor Author

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!

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Owner

@jaredpalmer jaredpalmer Feb 15, 2017

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?

Copy link
Contributor

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.

Copy link
Owner

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#45

Copy link
Collaborator

@JacopKane JacopKane Mar 23, 2018

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

Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants