Skip to content
GitLab
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
fe4dc744
Unverified
Commit
fe4dc744
authored
7 years ago
by
Dan Abramov
Committed by
GitHub
7 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Polyfill rAF in test environment (#3340)
parent
c66c296f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/react-scripts/config/polyfills.js
+6
-0
packages/react-scripts/config/polyfills.js
packages/react-scripts/package.json
+1
-0
packages/react-scripts/package.json
with
7 additions
and
0 deletions
+7
-0
packages/react-scripts/config/polyfills.js
+
6
-
0
View file @
fe4dc744
...
...
@@ -22,3 +22,9 @@ require('whatwg-fetch');
// Object.assign() is commonly used with React.
// It will use the native implementation if it's present and isn't buggy.
Object
.
assign
=
require
(
'
object-assign
'
);
// In tests, polyfill requestAnimationFrame since jsdom doesn't provide it yet.
// We don't polyfill it in the browser--this is user's responsibility.
if
(
process
.
env
.
NODE_ENV
===
'
test
'
)
{
require
(
'
raf
'
).
polyfill
(
global
);
}
This diff is collapsed.
Click to expand it.
packages/react-scripts/package.json
+
1
-
0
View file @
fe4dc744
...
...
@@ -48,6 +48,7 @@
"postcss-flexbugs-fixes"
:
"3.2.0"
,
"postcss-loader"
:
"2.0.6"
,
"promise"
:
"8.0.1"
,
"raf"
:
"3.4.0"
,
"react-dev-utils"
:
"^4.1.0"
,
"style-loader"
:
"0.19.0"
,
"sw-precache-webpack-plugin"
:
"0.11.4"
,
...
...
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