Skip to content

Commit 18ee2fc

Browse files
committed
Check for both package & package.json in ModuleScopePlugin
1 parent d382a94 commit 18ee2fc

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/react-dev-utils/ModuleScopePlugin.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ class ModuleScopePlugin {
4848
request.descriptionFileRoot,
4949
requestFullPath
5050
);
51-
if (requestRelativeToRoot === 'package.json') {
51+
if (
52+
requestRelativeToRoot === 'package.json' ||
53+
requestRelativeToRoot === 'package'
54+
) {
5255
return callback();
5356
}
5457
// Find path from src to the requested file

packages/react-scripts/template/src/App.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { Component } from 'react';
22
import logo from './logo.svg';
33
import './App.css';
4+
import { version, name } from '../../package.json';
45

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

0 commit comments

Comments
 (0)