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
24f511f3
Commit
24f511f3
authored
Jun 05, 2017
by
Arunoda Susiripala
Committed by
GitHub
Jun 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When detecting changed pages in hot-reloader use only pages. (#2171)
parent
443abba9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
hot-reloader.js
server/hot-reloader.js
+13
-2
No files found.
server/hot-reloader.js
View file @
24f511f3
...
...
@@ -7,6 +7,8 @@ import webpack from './build/webpack'
import
clean
from
'./build/clean'
import
getConfig
from
'./config'
const
isBundledPage
=
/^bundles
[/\\]
pages.*
\.
js$/
export
default
class
HotReloader
{
constructor
(
dir
,
{
quiet
,
conf
}
=
{})
{
this
.
dir
=
dir
...
...
@@ -78,7 +80,12 @@ export default class HotReloader {
compiler
.
plugin
(
'done'
,
(
stats
)
=>
{
const
{
compilation
}
=
stats
const
chunkNames
=
new
Set
(
compilation
.
chunks
.
map
((
c
)
=>
c
.
name
))
const
chunkNames
=
new
Set
(
compilation
.
chunks
.
map
((
c
)
=>
c
.
name
)
.
filter
(
name
=>
isBundledPage
.
test
(
name
))
)
const
failedChunkNames
=
new
Set
(
compilation
.
errors
.
map
((
e
)
=>
e
.
module
.
reasons
)
.
reduce
((
a
,
b
)
=>
a
.
concat
(
b
),
[])
...
...
@@ -86,7 +93,11 @@ export default class HotReloader {
.
reduce
((
a
,
b
)
=>
a
.
concat
(
b
),
[])
.
map
((
c
)
=>
c
.
name
))
const
chunkHashes
=
new
Map
(
compilation
.
chunks
.
map
((
c
)
=>
[
c
.
name
,
c
.
hash
]))
const
chunkHashes
=
new
Map
(
compilation
.
chunks
.
filter
(
c
=>
isBundledPage
.
test
(
c
.
name
))
.
map
((
c
)
=>
[
c
.
name
,
c
.
hash
])
)
if
(
this
.
initialized
)
{
// detect chunks which have to be replaced with a new template
...
...
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