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
662dfd42
Unverified
Commit
662dfd42
authored
Dec 31, 2018
by
Tim Neutkens
Committed by
GitHub
Dec 31, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop module.hot from production bundles (#5967)
parent
18cb2c03
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
page-loader.js
packages/next/client/page-loader.js
+15
-13
No files found.
packages/next/client/page-loader.js
View file @
662dfd42
...
@@ -14,7 +14,6 @@ function supportsPreload (list) {
...
@@ -14,7 +14,6 @@ function supportsPreload (list) {
}
}
const
hasPreload
=
supportsPreload
(
document
.
createElement
(
'link'
).
relList
)
const
hasPreload
=
supportsPreload
(
document
.
createElement
(
'link'
).
relList
)
const
webpackModule
=
module
export
default
class
PageLoader
{
export
default
class
PageLoader
{
constructor
(
buildId
,
assetPrefix
)
{
constructor
(
buildId
,
assetPrefix
)
{
...
@@ -107,21 +106,24 @@ export default class PageLoader {
...
@@ -107,21 +106,24 @@ export default class PageLoader {
}
}
}
}
// Wait for webpack to become idle if it's not.
if
(
process
.
env
.
NODE_ENV
!==
'production'
)
{
// More info: https://github.com/zeit/next.js/pull/1511
// Wait for webpack to become idle if it's not.
if
(
webpackModule
&&
webpackModule
.
hot
&&
webpackModule
.
hot
.
status
()
!==
'idle'
)
{
// More info: https://github.com/zeit/next.js/pull/1511
console
.
log
(
`Waiting for webpack to become "idle" to initialize the page: "
${
route
}
"`
)
if
(
module
.
hot
&&
module
.
hot
.
status
()
!==
'idle'
)
{
console
.
log
(
`Waiting for webpack to become "idle" to initialize the page: "
${
route
}
"`
)
const
check
=
(
status
)
=>
{
if
(
status
===
'idle'
)
{
const
check
=
(
status
)
=>
{
webpackModule
.
hot
.
removeStatusHandler
(
check
)
if
(
status
===
'idle'
)
{
register
()
module
.
hot
.
removeStatusHandler
(
check
)
register
()
}
}
}
module
.
hot
.
status
(
check
)
return
}
}
webpackModule
.
hot
.
status
(
check
)
}
else
{
register
()
}
}
register
()
}
}
async
prefetch
(
route
)
{
async
prefetch
(
route
)
{
...
...
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