Skip to content

Commit

Permalink
fix importing package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdoron committed Jun 22, 2017
1 parent d22a9df commit 9ef9fcb
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/react-dev-utils/ModuleScopePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,19 @@ class ModuleScopePlugin {
if (relative.startsWith('../') || relative.startsWith('..\\')) {
return callback();
}
const requestFullPath = path.resolve(
path.dirname(request.context.issuer),
request.__innerRequest_request
);
const descriptionFileRelativeToRoot = path.relative(
request.descriptionFileRoot,
request.descriptionFilePath
requestFullPath
);
if (descriptionFileRelativeToRoot === 'package.json') {
return callback();
}
// Find path from src to the requested file
const requestRelative = path.relative(
appSrc,
path.resolve(
path.dirname(request.context.issuer),
request.__innerRequest_request
)
);
const requestRelative = path.relative(appSrc, requestFullPath);
// Error if in a parent directory of src/
if (
requestRelative.startsWith('../') || requestRelative.startsWith('..\\')
Expand Down

0 comments on commit 9ef9fcb

Please sign in to comment.