Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Meta
create-react-app
Commits
4feff2ac
Commit
4feff2ac
authored
8 years ago
by
Michal Kvasničák
Committed by
Dan Abramov
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Make webpackHotDevClient support webpack 2 too (#840)
* Support webpack 2 * Code style
parent
df21070e
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/react-dev-utils/webpackHotDevClient.js
+17
-3
packages/react-dev-utils/webpackHotDevClient.js
with
17 additions
and
3 deletions
+17
-3
packages/react-dev-utils/webpackHotDevClient.js
+
17
-
3
View file @
4feff2ac
...
...
@@ -272,8 +272,7 @@ function tryApplyUpdates(onHotUpdateSuccess) {
return
;
}
// https://webpack.github.io/docs/hot-module-replacement.html#check
module
.
hot
.
check
(
/* autoApply */
true
,
function
(
err
,
updatedModules
)
{
function
handleApplyUpdates
(
err
,
updatedModules
)
{
if
(
err
||
!
updatedModules
)
{
window
.
location
.
reload
();
return
;
...
...
@@ -288,5 +287,20 @@ function tryApplyUpdates(onHotUpdateSuccess) {
// While we were updating, there was a new update! Do it again.
tryApplyUpdates
();
}
});
}
// https://webpack.github.io/docs/hot-module-replacement.html#check
var
result
=
module
.
hot
.
check
(
/* autoApply */
true
,
handleApplyUpdates
);
// // Webpack 2 returns a Promise instead of invoking a callback
if
(
result
&&
result
.
then
)
{
result
.
then
(
function
(
updatedModules
)
{
handleApplyUpdates
(
null
,
updatedModules
);
},
function
(
err
)
{
handleApplyUpdates
(
err
,
null
);
}
);
}
};
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets