Skip to content

Commit

Permalink
React fast refresh - devDependency (parcel-bundler#4999)
Browse files Browse the repository at this point in the history
  • Loading branch information
robintom authored Aug 13, 2020
1 parent 4c699d6 commit 803ec97
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/runtimes/react-refresh/src/ReactRefreshRuntime.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ export default (new Runtime({
let entries = bundle.getEntryAssets();
for (let entry of entries) {
let pkg = await entry.getPackage();
if (pkg && pkg.dependencies && pkg.dependencies['react']) {
if (
pkg &&
((pkg.dependencies && pkg.dependencies['react']) ||
(pkg.devDependencies && pkg.devDependencies['react']))
) {
return {
filePath: __filename,
code: CODE,
Expand Down

0 comments on commit 803ec97

Please sign in to comment.