Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react-dev-utils/ModuleScopePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ModuleScopePlugin {
)
);
// Error if in a parent directory of src/
if (requestRelative[0] === '.') {
if (requestRelative.startsWith('../')) {
Copy link
Contributor

@Timer Timer May 29, 2017

Choose a reason for hiding this comment

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

This should probably use path.sep instead of / for cross platform reasons. 😄
You could also be explicit and just add a second case for \.


Should we change the check above, too? I'm not sure if people use dot directories often.

Copy link
Author

@diligiant diligiant May 29, 2017

Choose a reason for hiding this comment

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

Thank you for the windows "reminder"! I added a second case to match the style above in the code.
I also fixed the first detection (different situation though).

callback(
new Error(
`You attempted to import ${chalk.cyan(request.__innerRequest_request)} which falls outside of the project ${chalk.cyan('src/')} directory. ` +
Expand Down