Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
7bb7d706
Unverified
Commit
7bb7d706
authored
Nov 11, 2019
by
Joe Haddad
Committed by
GitHub
Nov 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polyfill `Object.assign` by Default (#9369)
* Polyfill `Object.assign` by Default * fix formatting
parent
6bf87b35
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
38 additions
and
0 deletions
+38
-0
object-assign.js
packages/next/build/polyfills/object-assign.js
+3
-0
auto.js
packages/next/build/polyfills/object.assign/auto.js
+1
-0
implementation.js
...ages/next/build/polyfills/object.assign/implementation.js
+1
-0
index.js
packages/next/build/polyfills/object.assign/index.js
+10
-0
polyfill.js
packages/next/build/polyfills/object.assign/polyfill.js
+3
-0
shim.js
packages/next/build/polyfills/object.assign/shim.js
+3
-0
webpack-config.ts
packages/next/build/webpack-config.ts
+16
-0
polyfills.js
packages/next/client/polyfills.js
+1
-0
No files found.
packages/next/build/polyfills/object-assign.js
0 → 100644
View file @
7bb7d706
var
assign
=
Object
.
assign
.
bind
(
Object
)
module
.
exports
=
assign
module
.
exports
.
default
=
module
.
exports
packages/next/build/polyfills/object.assign/auto.js
0 → 100644
View file @
7bb7d706
// noop
packages/next/build/polyfills/object.assign/implementation.js
0 → 100644
View file @
7bb7d706
module
.
exports
=
Object
.
assign
packages/next/build/polyfills/object.assign/index.js
0 → 100644
View file @
7bb7d706
var
assign
=
Object
.
assign
.
bind
(
Object
)
function
g
()
{
return
assign
}
Object
.
defineProperties
(
g
(),
{
implementation
:
{
get
:
g
},
shim
:
{
value
:
g
},
getPolyfill
:
{
value
:
g
},
})
module
.
exports
=
g
()
packages/next/build/polyfills/object.assign/polyfill.js
0 → 100644
View file @
7bb7d706
module
.
exports
=
function
()
{
return
Object
.
assign
}
packages/next/build/polyfills/object.assign/shim.js
0 → 100644
View file @
7bb7d706
module
.
exports
=
function
()
{
return
Object
.
assign
}
packages/next/build/webpack-config.ts
View file @
7bb7d706
...
@@ -60,11 +60,27 @@ function getOptimizedAliases(isServer: boolean): { [pkg: string]: string } {
...
@@ -60,11 +60,27 @@ function getOptimizedAliases(isServer: boolean): { [pkg: string]: string } {
}
}
const
stubWindowFetch
=
path
.
join
(
__dirname
,
'polyfills'
,
'fetch.js'
)
const
stubWindowFetch
=
path
.
join
(
__dirname
,
'polyfills'
,
'fetch.js'
)
const
stubObjectAssign
=
path
.
join
(
__dirname
,
'polyfills'
,
'object-assign.js'
)
const
shimAssign
=
path
.
join
(
__dirname
,
'polyfills'
,
'object.assign'
)
return
{
return
{
// Polyfill: Window#fetch
__next_polyfill__fetch
:
require
.
resolve
(
'whatwg-fetch'
),
__next_polyfill__fetch
:
require
.
resolve
(
'whatwg-fetch'
),
unfetch
$
:
stubWindowFetch
,
unfetch
$
:
stubWindowFetch
,
'isomorphic-unfetch$'
:
stubWindowFetch
,
'isomorphic-unfetch$'
:
stubWindowFetch
,
'whatwg-fetch$'
:
stubWindowFetch
,
'whatwg-fetch$'
:
stubWindowFetch
,
// Polyfill: Object.assign
__next_polyfill__object_assign
:
require
.
resolve
(
'object-assign'
),
'object-assign$'
:
stubObjectAssign
,
'@babel/runtime-corejs2/core-js/object/assign'
:
stubObjectAssign
,
// Stub Package: object.assign
'object.assign/auto'
:
path
.
join
(
shimAssign
,
'auto.js'
),
'object.assign/implementation'
:
path
.
join
(
shimAssign
,
'implementation.js'
),
'object.assign$'
:
path
.
join
(
shimAssign
,
'index.js'
),
'object.assign/polyfill'
:
path
.
join
(
shimAssign
,
'polyfill.js'
),
'object.assign/shim'
:
path
.
join
(
shimAssign
,
'shim.js'
),
}
}
}
}
...
...
packages/next/client/polyfills.js
View file @
7bb7d706
import
'__next_polyfill__fetch'
import
'__next_polyfill__fetch'
Object
.
assign
=
require
(
'__next_polyfill__object_assign'
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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