Skip to content
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

Fix stringifyRequest in windows when context and request is not in the same driver #14

Merged
merged 1 commit into from
Nov 20, 2015

Conversation

sorrycc
Copy link
Contributor

@sorrycc sorrycc commented Jul 23, 2015

For example:

var context = 'C:\foo';
var request = 'E:\bar';

path.relative(context, request);  // -> E:\bar
"./" + path.relative(context, part); // -> ./E:\bar, And this file path is not found

@sorrycc
Copy link
Contributor Author

sorrycc commented Jul 24, 2015

ping

@afc163
Copy link

afc163 commented Aug 28, 2015

👍

1 similar comment
@gbk
Copy link

gbk commented Nov 18, 2015

+1

gbk referenced this pull request in webpack/webpack Nov 18, 2015
if(/^\/|^[A-Z]:/i.test(part) && context)
return "./" + path.relative(context, part).replace(/\\/g, "/");
if(/^\/|^[A-Z]:/i.test(part) && context) {
part = path.relative(context, part).replace(/\\/g, "/");
Copy link
Member

Choose a reason for hiding this comment

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

Could you move the replace to the else case? Absolute windows path should have \.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

sokra added a commit that referenced this pull request Nov 20, 2015
Fix stringifyRequest in windows when context and request is not in the same driver
@sokra sokra merged commit 8b0f6ab into webpack:master Nov 20, 2015
@sokra
Copy link
Member

sokra commented Nov 20, 2015

Thanks

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