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
f5385b47
Commit
f5385b47
authored
4 years ago
by
Fabian Keller
Browse files
Options
Download
Email Patches
Plain Diff
attempt to fix custom loader race condition
parent
fddce8a9
github/fork/bluenote10/bugfix/attempt_to_fix_custom_loader_race_condition
1 merge request
!10874
Attempt to fix custom loader race condition
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/react-dev-utils/WebpackDevServerUtils.js
+9
-3
packages/react-dev-utils/WebpackDevServerUtils.js
with
9 additions
and
3 deletions
+9
-3
packages/react-dev-utils/WebpackDevServerUtils.js
+
9
-
3
View file @
f5385b47
...
...
@@ -141,9 +141,13 @@ function createCompiler({
if
(
useTypeScript
)
{
compiler
.
hooks
.
beforeCompile
.
tap
(
'
beforeCompile
'
,
()
=>
{
tsMessagesPromise
=
new
Promise
(
resolve
=>
{
tsMessagesResolver
=
msgs
=>
resolve
(
msgs
);
});
// Make sure promise is only created once. Multiple 'beforeCompile' calls are possible
// with custom loaders.
if
(
tsMessagesPromise
==
null
)
{
tsMessagesPromise
=
new
Promise
(
resolve
=>
{
tsMessagesResolver
=
msgs
=>
resolve
(
msgs
);
});
}
});
forkTsCheckerWebpackPlugin
...
...
@@ -190,6 +194,8 @@ function createCompiler({
},
100
);
const
messages
=
await
tsMessagesPromise
;
tsMessagesPromise
=
null
;
// release promise to allow for subsequent 'beforeCompile' calls
clearTimeout
(
delayedMsg
);
if
(
tscCompileOnError
)
{
statsData
.
warnings
.
push
(...
messages
.
errors
);
...
...
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