Skip to content

Commit

Permalink
Check for both package & package.json in ModuleScopePlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdoron committed Jun 22, 2017
1 parent d382a94 commit 18ee2fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/react-dev-utils/ModuleScopePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ class ModuleScopePlugin {
request.descriptionFileRoot,
requestFullPath
);
if (requestRelativeToRoot === 'package.json') {
if (
requestRelativeToRoot === 'package.json' ||
requestRelativeToRoot === 'package'
) {
return callback();
}
// Find path from src to the requested file
Expand Down
2 changes: 2 additions & 0 deletions packages/react-scripts/template/src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import { version, name } from '../../package.json';

class App extends Component {
render() {
Expand All @@ -9,6 +10,7 @@ class App extends Component {
<div className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h2>Welcome to React</h2>
<p>{`${name} v${version}`}</p>
</div>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
Expand Down

0 comments on commit 18ee2fc

Please sign in to comment.